How does it make no difference, when it compiles to Elixir?
Because the bytecode is critical?
So, ErlangVM makes no performance loss?
That would be even more amazing since it combines the speed of OCaml with the concurrency of Elixir? ^-^
How does it make no difference, when it compiles to Elixir?
Because the bytecode is critical?
So, ErlangVM makes no performance loss?
That would be even more amazing since it combines the speed of OCaml with the concurrency of Elixir? ^-^
As in if you compile from OCaml to Elixir then you get the BEAM’s speed regardless.
Yeah, i thought native OCaml is in much terms faster as BEAM?
@OvermindDL1 I’m a bit curious, I see that you like Graphql, so… Did you use Graphql with bluckescript? If yes, how?
Native compilation yes, it is faster than the BEAM on anything single-threaded, it is about on par with C in speed. But when you transpile it to execute on the BEAM instead, well it does not matter what assembly it generates since it is generating BEAM at that point. ^.^
Not used it with bucklescript yet, it exists on the layer ‘above’ in my project (it predates my Bucklescript work). I would like to make a GraphQL interface for buckelscript-tea sometime though. ^.^
And how is that faster as native OCaml?
It’s not, the BEAM is slower on single processing work, like math and such. However the BEAM will run circles around OCaml in terms of any kind of massive asynchronicity, like a web server ^.^.
But with OCaml you could get the best of both worlds, have some of it compile it the BEAM, and some of it compile to NIF’s.
EDIT: For note, MC-OCaml (when it is finally merged into the mainline) will run circles around the BEAM in about every way possible, but in exchange for less reliability as the BEAM is fairly crashless, but there are ways to work around that too.
Yes, this is exactly what I mean. And how can we achieve this?
Is there any group/person we can hint about this idea?
How challanging is that? What exactly to do, step by step?
To do what? Make an Elixir/Core backend for OCaml? Only thing that involves is just someone starting to write a PPX for OCaml that does it.
Not too challenging overall, easier than a whole compiler for sure, but it necessitates knowing the OCaml compiler a bit (which is probably the easiest to read compiler out, so that is a boon).
EDIT: For note, MC-OCaml (when it is finally merged into the mainline) will run
circles around the BEAM in about every way possible,
Every way possible is a bit strong isn’t it? Unless they are
implementing a good pre-emptive scheduler I bet you the worst-case
latency is going to be worse in OCaml (as in almost every other language
having a non pre-emptive scheduler).
I’ve done some benchmarking comparing java, go and erlang and while java
and go are faster on average they also behave much worse under load
(especially java). Beam seems to give much more stable latency. I think
MC-OCaml will be the same.
Plus, who knows where the beam will be in 2027 when MC-OCaml finally is
released
Do you think a unifying interface is senseful?
I’ll be waiting for it good luck
MC-OCaml is just implementing an Algebraic Effects system while removing the GIL, it comes with no scheduler, but via using the new Algebraic Effects system and certain new hooks you can make just about any scheduler that you can dream of. So yes, you can make a pre-emptive scheduler in it.
That all depends on how you build your scheduler, you can build one to be identical to the BEAM for example.
Interface? No. Language? Yes. If the language is expressive and safe enough.
Do you think it makes sense to move this topic to … an own topic?
Maybe we can find some more people, who show interest
Thanks a lot
Perhaps, though ‘Why Bucklescript?’ is really ‘Why OCaml?’. ^.^
But there are others, and I’d love to start such a PPX, just no time currently, maybe in a month or so unless someone beats me to it (please). ^.^;
I mean more like something like “Unite Elixir with OCaml” or so.
So, I am open to help in each helpful way.
As in a new language or a PPX?
I think a PPX, you said?
That is how you’d get OCaml to compile to Elixir/Core/Whatever yep, it is a compiler plugin. Not terribly well documented (it is a fairly new compiler feature) but not hard to pick up.
And what you mean by new language?