Programming languages on Haiku?

There’s to be no final, uptodate list which programming languages are available on Haiku. Or I just haven’t found it. (Please point me to that list, if it exists.)

It seems there are these:

C, C++, Python, YaBasic, Vala, D, bash. I’m sure there are more? (At least several non-bash shells and gcc-frontends, I guess.)

1 Like

FreePascal is also available. AND there have been some efforts to bring the port of Go to something close to the current version. Though importantly, most non-C++ languages do not have bindings to any of the native Haiku APIs per se.

2 Likes

Off the top of my head Lua and Perl are also avaliable.

D can be compiled with some coercing iirc but I don’t think it’s readily available :thinking:
(Or maybe it’s very outdated, I remember having issues compiling things with dmd)

I’m sure there’s many more

Edit: Mono and .NET were available or close to available too at some point.

1 Like

There’s also perl available (not sure if anyone uses it anymore), and there was a port of Swift some years ago (not sure if that’s still working or maintained)

The closest thing to an up-to-date list would probably be to look at the haikuports repo under the “dev-lang” directory. But not all ports there necessarily have to be in working condition.

1 Like

A very long time ago I ported SWI Prolog but I am not sure if it still works, I have not checked on the recipe in years. However it was an easy port so shouldn’t be difficult to update.

1 Like

Nim,Rust and PHP are also available

3 Likes

Thanks. That’s a good tip!

I see that also my beloved Nasm is there :slight_smile:

(For some reason unknown to me, several languages are listed in the haikuports-repo’s top dir. Like Lisp, Scheme, Tcl, Go and more.)

Yeah, I noticed that too. No idea why. Maybe one of the Haikuports guys can answer this.

I’ve used Rust and Ocaml, and Guida.

(Guida isn’t in HaikuDepot, you have to download it, but you don’t have to port it - the compiler is a Node program, if I remember right. It’s a reimplementation of Elm, a Hasell-like javascript compiler.)

I haven’t used it on Haiku, but “es” is in HaikuDepot - an interesting shell programming language.

Speaking of shell program, there are of course awk (really gawk) and sed. Awk is mighty useful.

There’s FORTRAN, though I hardly recognize the language I started with in the ‘70s.

As far as I know, those directories are for language-specific libraries and stuff (like python submodules etc.), C++ also has it. (assuming you’re referring to dev-cpp, dev-python et al.)

1 Like

The layout and package naming comes from Gentoo Linux and they do some strange things sometimes. Usually the main compiler/interpreter is in dev-lang, with the other bits/libraries/tools in specific directories like dev-perl, dev-python, etc… This isn’t always the case though.

2 Likes

Also, see: Haiku Developer Tools Update (October 2023) | Haiku Project

Various contributors port things like FreeCOBOL, Ada, BCPL, ALGOL, BASIC, Assembler (various CPUs), glslang, etc.

64tass dmd fpc_source kona nasm-segelf perl ruby swig w2c2
acme duktape gambas lazarus nhc98 php rust tcc xamos
algol68g elixir ghc lua nim python rust_bin tcl yab
bacon erlang gnucobol luajit ocaml qbe rust_wasm_bin tiny yasm
brexx fasm golang mono odin quickjs spidermonkey tk
camlp5 fennel hugs98 mujs openjdk r squirrel vala
clips fpc janet naken_asm opensmalltalk_vm rebol swi_prolog vasm
cppfront fpc_bootstrap julia nasm orc retro swift_lang vlink

2 Likes

humdrum, mainstream languages. I’ve got the really esoteric stuff

7 Likes

Ruby is another.

Ada is working, just needs to be packaged.

1 Like

At this point you may have an easier job listing the ones that are not available yet.

But let’s add REXX to the list of available languages as well.

5 Likes

Chicken Scheme is there too, but the compiler fails to build executables, so you’re restricted to the interpreter. Fans of Common Lisp have ECL and SBCL as well.

Unfortunately Rexx is only there in the form of a quirky old interpreter called BRexx, but Regina should be easy enough to build from source; I can try later if anyone’s curious.

That’s because modern Fortran is not exactly FORTRAN (mind the difference in capitalization). Starting with the Fortran 90 revision, the language introduced lots of modern features, and keeps evolving since then. You probably mean FORTRAN 77, which is considered legacy since the 90s. However Fortran is notorious for backwards compatibility, so you can easily compile legacy code. This makes sense since there are tons of legacy tried-and-true numerical codes, written in the 77 standard.

Haiku has gfortran as part of GCC. I use it extensively, and it works great.

1 Like

Has haiku freebasic?

Yes, see michel’s post above.