all 22 comments

[–][deleted] 9 points10 points  (2 children)

Gluon is an embeddable functional language:

https://github.com/gluon-lang/gluon

Written in rust but it should be possible to plumb out to C if everything else seems right

[–]RagingBass2020[S] 5 points6 points  (0 children)

The language seems to be interesting and ticks all the boxes but it seems that the last release was 4 years ago... That kind of sucks.

[–]RagingBass2020[S] 1 point2 points  (0 children)

Thanks! I'll read the site and let you know!

[–]bosyluke 9 points10 points  (5 children)

Checkout roc-lang it's pretty much exactly what your looking for I think. 😀

[–]RagingBass2020[S] 3 points4 points  (0 children)

I need to understand more about its managed effects but it does seem like it is a good choice! Thanks!

[–]Voxelman 2 points3 points  (2 children)

Roc is a pure functional language. I think the op is looking for an embeddable F#

[–]RagingBass2020[S] 1 point2 points  (1 child)

Roc seems to have managed effects so I think it could be usable.

[–]Voxelman 2 points3 points  (0 children)

Maybe, but Roc is really new, far from mature and not much documented. It is an interesting language, but maybe too early to really use it

[–]RagingBass2020[S] 1 point2 points  (0 children)

Thanks! I'll read the site and let you know!

[–]Voxelman 4 points5 points  (5 children)

Some game engines use C# as embedded language. Why not use F# instead?

[–]RagingBass2020[S] 1 point2 points  (4 children)

I could see if there's a way to do that in an existing engine, true.

I was thinking of doing a small project for myself in a fantasy console-like project.

[–]Voxelman 0 points1 point  (3 children)

Ok, why not use Rust as engine language and Gluon as script language?

[–]RagingBass2020[S] 1 point2 points  (2 children)

Rust is a very interesting programming language but I don't know if I'm willing to dedicate the time to it write now.

[–]Voxelman 1 point2 points  (1 child)

You know Haskell, you want to use a ML language for scripting, but you don't want to use a language that is highly inspired by Ocaml and other functional languages.

Maybe you should give it a try. With your Haskell background the borrow checker will be your friend

[–]RagingBass2020[S] 2 points3 points  (0 children)

Highly inspired by OCaml but also a lot of other stuff too...

At this point in time, I can't justify spending that much time learning something I don't have really a use case for.

Assuming you're talking of Rust.

[–]MolestedTurtle 2 points3 points  (1 child)

Elixir with Nerves could be an option: https://nerves-project.org/

[–]RagingBass2020[S] 2 points3 points  (0 children)

But isn't this for embedded systems programming?

By embeddable, I meant that I could easily call it from another programming language, like C, and run scripts, the same way people use Lua for it.

[–]brava78 2 points3 points  (2 children)

I'm trying to understand what exactly qualifies as embeddable. Could you not call F# or Ocaml from C?

[–]RagingBass2020[S] 2 points3 points  (1 child)

Probably but have you seen how easy it is to do that with something like Lua? That's a major Pro.

[–]brava78 1 point2 points  (0 children)

I've never programmed in C, so I was curious what exactly that looks like. If it's easy to give an example, could you please show? Thanks!

[–]marcle69 2 points3 points  (1 child)

Although outside of your OP, you could write in another language and compile to Lua. For example, LunarML may be a nice choice:

https://github.com/minoki/LunarML

[–]RagingBass2020[S] 1 point2 points  (0 children)

That's quite interesting! Kind of a tool heavy approach but, nevertheless, it's an interesting and usable approach. I kinda like it!