Development environment

Personally I am quite happy with vim (using YouCompleteMe which works from compile_command.json, I get all the autocompletion I need).

I understand that not everyone will be happy with using vim, but in that case your help is welcome improving and better documenting one of the other existing options :slight_smile:

1 Like

Hmm, maybe it is a matter of good documentation too?!
Or better manuals or communication about the various combinations?

I feel like I’m repeating myself but… this is a chicken and egg situation we have everywhere (web browser etc.)

If everyone just wishes for some good native development experience, and then goes on to improve non-native options, we will never get that good native experience. I can understand that not everyone wants to work on developer tools, but then expecting one or two people that do, to compete with entire departments is not reasonable.

For example, development of Koder has stalled recently because it does everything I need it to reasonably well, and I don’t have as much motivation to work on it, as I did when I started the project. Even then, there is also work to be done on Scintilla itself, and I don’t want to spend all my Haiku time working on devtools either.

If you don’t like my opinionated vision for the project (standalone editor to integrate with other programs like Paladin, instead of being a full-blown IDE), then there are others that do intend to be integrated solutions like BeIDE was. [1]

Answering the questions from the first post:

Are you working on Haiku itself or apps?

Both, wanted to be app developer, got sucked into the main project. Still, I’m trying to focus more on apps.

What editor do you use? Do you have any special configs that others could find useful?

On Haiku: Koder, of course :wink: For exploring code bases and “code completion” I use TextSearch.
On Linux: VS Code.

Do you use Haiku itself for development or do you cross compile?

3rd-party/system apps: Haiku. Kernel/drivers: Linux, because of accelerated virtualization.

Footnotes:
[1] My problem with developing IDEs is that all of them have to reimplement certain features, like the editor. Even if you use something like Scintilla, this is just the foundation, and you need fair amount of work for it to be useful.
This can be mitigated by more modular design which I’m experimenting with in Koder, mainly because it’s easier to maintain, but if it facilitates more code sharing - great.

9 Likes

Thank you very much for the link to ideam.
I didn’t know the project before,but I think that’s exactly what I was looking for: A native replacement to KDevelop which works in a similar way.
I’ll try it out as soon as I find some time for it.

1 Like

Ideam looks good, but also seems to be very early.

Yes and it hasn’t been updated for three years.
Still,if it works,it can be a good point to start with improving it,adding advanced features and so on.

1 Like

I could bet that with the help of yab you could create a suitable editor for haiku projects. This is exactly where yab has its strengths. it wouldn’t be the first IDE built with it.

It would only take someone who has enough experience in c and cpp, who knows how to transfer data to the makefile engine and how to compile programs.

With yab one would create the gui and the executors work with the command line.

If you want to bring jam and you can do this via the command line, that should also be possible.

If you also had the chance to convert / export yab programs as c or cpp, then that would be perfect for building GUIs.

1 Like

I started a BASIC to C++ transpiler using C++11 but I never finished. It’s still on my GitHub account if somebody with more fluent C++ wants to take it over.

Right now I’m learning Rust and it is pretty good to use with Intellisense. Is there anything close to VS Code on Haiku? There is only native code generation for Rust on Haiku but no cross-compiler toolchains for Haiku programming in Rust.

1 Like

Adding support for LSP to Koder might be worthwhile. Not necessarily something Kacper has to do but maybe other interested parties. While LSP is not perfect it generally seems to be the easiest way to add code completion and other IDE-like features to an editor for many languages as easily as possible.

Along with the above it would be good to pick one of the C++ LSP servers (there are a few) and getting them working well on Haiku, if they aren’t already. Maybe integrating PulkoMandy’s compile_commands.json in some way as well so that it just works out of the box for Haiku code. This will also help other editors like vim, Neovim and Emacs work better on Haiku for developing Haiku code.

1 Like

As I said, vim already has YouCompleteMe (based on clang/llvm and using compile_commands) so it needs no help :slight_smile:

YouCompleteMe is also a client-server system and the server could also be reused for other editors, as an alternative to LSP.

1 Like

Hi Lelldorin,
maybe a.tutorial how to use vim and youcompleteme for the todo-list?!

Is there a tutorial, how to use it?

  • Install it: pkgman install youcompleteme_x86
  • You need a compile_commands.json file. For Haiku this is created using jam -acn @nightly-anyboot (or other profile you are using). It Make sure the resulting file is named compile_commands.json and is placed in Haiku sources root directory (not in generated).
  • Edit files with vim. Now whenever you type something, you get a popup menu with the available completions, and at the top of the window you get a line which shows you the function prototypes

For things other than Haiku, projects using jam can get a compile_commands file in the same way. For projects using cmake it is also possible. For projects using make it is more complicated, another tool (called bear) needs to be used. I have not tried this yet.

Once you have a compile_commands file, you can also use other applications that rely on it, for example SourceTrail is a nice tool to explore an unknown codebase and find how things are connected together.

4 Likes

bear was used to port SBCL: Porting SBCL Common Lisp to Haiku - #18 by hoanga

Sounds rather complicated for a non developer.
Is it snyway nice to learn if not for programming?

For a novice/beginner Koder and Terminal is enough?
Or better use Pe?

Why do you need a code completion tool if you are not a developer?

2 Likes

How is it complicated? You need to install it (you certainly don’t need to be a developer for this) and then run one command in Terminal.

And this is indeed for people who want to write code. I think it is fair to assume they know how to run commands in a Terminal? Is that already too much to ask?

3 Likes

Didn’t realize this could be installed through pkgman. I always have done through Vim plugins… In my case, vim-plugged and using the vimrc config file. Though to be honest, I need to reinstall some plugins after vim gets updated. Seems some plugins don’t like Vim to be updated.

I usually have issues with vim-codedark color theme… :thinking: Then I need to comment the line in vimrc, load plugins and then uncomment the line to be back on track.

Why would that be?

Regards,
RR

I usually use other ways to install vim plugins, but YouCompleteMe is a bit tricky because the official distribution tries to build llvm during the installation process and this fails on Haiku. So a specific process was needed and it was simpler to put that in a recipe for future reuse. Maybe it is simpler now that it uses clangd instead of libclang.

Seems strange. It could be that the plugin caches the path to something, and the thing is moved on updates (especially if it uses a path in /packages/ instead of /system/…, I don’t fully understand why we need to have all files exposed a second time in /packages).

i am not sure if you meant this bear or Armed Bear. for the sbcl port, it was the latter (required for the bootstrap).