Live data from Hacker News

OCaml on Baremetal Shakti RISC-V Processor

kcsrk.info

21–30 of 77 posts

Re: OCaml on Baremetal Shakti RISC-V Processor

#21
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

This is OCaml's problem: it's a great language with no users. ReasonML is trying to solve this by making it more approachable, and they're making steady progress.

Re: OCaml on Baremetal Shakti RISC-V Processor

#23
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

OCaml is very good at symbolic computations, and not so good at floating point computations. Therefore it's a very good language for writing compilers etc.

Further than that, there are no more programs written in it for the same reason than there are no more programs written in any interesting languages, I guess; ie largely accidental.

Re: OCaml on Baremetal Shakti RISC-V Processor

#24

Ironically, the bootloader is still assembly with C++. Then again, maybe that is not the interesting thing to do in OCaml.

I'm not sure that's ironic. I believe the OCaml runtime is written in C as well.

Many times that is a matter of convenience, other than trying to prove a point doing a full bootstrap.

Re: OCaml on Baremetal Shakti RISC-V Processor

#25

Ironically, the bootloader is still assembly with C++. Then again, maybe that is not the interesting thing to do in OCaml.

Malte here, I developed the bootcode. While I agree with you, it's about the minimum you can do in C/ASM land before starting up OCaml. The bootcode just initializes the registers to zero, setups a trap handler and the stack and heap. This is impossible to do from OCaml as it does not allow direct register/memory access as a language feature.

Re: OCaml on Baremetal Shakti RISC-V Processor

#26
post #23
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

OCaml is very good at symbolic computations, and not so good at floating point computations. Therefore it's a very good language for writing compilers etc. Further than that, there are no more programs written in it for the same reason than there are no more programs written in any interesting languages, I guess; ie largely accidental.

> and not so good at floating point computations

What does this mean? I was under the impression the OCaml compiler did a decent number of floating point specific optimizations, like unboxed arrays and what not.

Re: OCaml on Baremetal Shakti RISC-V Processor

#27
post #23

Earlier quoted context omitted.

OCaml is very good at symbolic computations, and not so good at floating point computations. Therefore it's a very good language for writing compilers etc. Further than that, there are no more programs written in it for the same reason than there are no more programs written in any interesting languages, I guess; ie largely accidental.

> and not so good at floating point computations What does this mean? I was under the impression the OCaml compiler did a decent number of floating point specific optimizations, like unboxed arrays and what not.

Surprised me as well janestreet are a well known user of ocaml and I can't imagine they don't use a lot of floats.

Re: OCaml on Baremetal Shakti RISC-V Processor

#28
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

Frama-C and Why3. Okay, maybe they're somewhat "language" projects since one is parsing C and another has its own language :)

Re: OCaml on Baremetal Shakti RISC-V Processor

#29
post #21
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

This is OCaml's problem: it's a great language with no users. ReasonML is trying to solve this by making it more approachable, and they're making steady progress.

There are some really cool projects popping up with ReasonML - here are a few:

- A package manager like NPM, but for native code: https://github.com/esy/esy

- A fast Node version manager: https://github.com/Schniz/fnm

- A fast replacement for dotenv-cli: https://github.com/ulrikstrid/reenv

- A fast JS bundler: https://github.com/fastpack/fastpack

- A native language server: https://github.com/jaredly/reason-language-server

The OCaml language and toolchain is very powerful... and I do believe ReasonML makes it more approachable, at least for a wider audience of developers comfortable with JavaScript-style syntax.

Re: OCaml on Baremetal Shakti RISC-V Processor

#30
post #6

OCaml is a beautiful language but I haven't seen any big non language projects written in OCaml. Does any one know why? OR do such projects exist and it is only that I am not aware of them?

The Fastest Fourier Transform in the West (FFTW) library is an example of a ubiquitous software product using OCaml. The FFTW library is a C library, but it is in large parts generated by an OCaml program, genfft (from the FAQ http://www.fftw.org/faq/section2.html#languages)
Post reply on HN