ERRATA: 6:45 - Gleam lists use a custom type for JS which can be switched to/from using custom `toList` and `fromList` functions NOTES: - You can FFI into Elixir, too! Just specify the `erlang` target and use the module name as you would in Erlang (thanks @JLarky!)
Nice video again. Do you plan on doing one about hosting a gleam backend app? I struggle with finding info about that - I suppose a server running erlang vm is enough but a deep dive would be so nice
They're generally not. You shouldn't be writing enough JS to the point where you need classes, honestly. However, if you NEED to return a class instance, you can, but you shouldn't try to introspect it on the Gleam side. In this case I would create a type with 0 constructors, like I did with the Date type.
That's kinda unlikely. Gleam doesn't compile to Python, so it wouldn't make a lot of sense. You'd have to spin up a whole new Python process just to execute the code
ERRATA:
6:45 - Gleam lists use a custom type for JS which can be switched to/from using custom `toList` and `fromList` functions
NOTES:
- You can FFI into Elixir, too! Just specify the `erlang` target and use the module name as you would in Erlang (thanks @JLarky!)
Nice video again. Do you plan on doing one about hosting a gleam backend app? I struggle with finding info about that - I suppose a server running erlang vm is enough but a deep dive would be so nice
Ooh good idea! Yeah any Erlang server would do, and I believe there are also some deployment guides on the Gleam website
@@IsaacHarrisHolt Oh my god you're right, thanks !
No worries!
Fun fact, you can also ffi into Elixir :)
Yes! This is true, but I managed to miss it out of the video
I've added this to the pinned comment :)
@@IsaacHarrisHolt yeah, the best part is that it allows you to install Elixir dependencies from hex, which makes it really easy to use
Yes! Though I've been informed that you can just use the Elixir module name :)
Can gleam call JS when the compilation target is Erlang?
It cannot
But how are js classes represented by gleam? 🤔
They're generally not. You shouldn't be writing enough JS to the point where you need classes, honestly. However, if you NEED to return a class instance, you can, but you shouldn't try to introspect it on the Gleam side.
In this case I would create a type with 0 constructors, like I did with the Date type.
@@IsaacHarrisHolt I guess that makes sense, thanks!
No worries!
Thinking of getting into gleam , the syntax kinda looks look like rust and i kinda had a bit tough time with it , so is gleam easy? Or same as rust?
Syntax and language difficulty are not correlated! Gleam is really easy to pick up, and I'd recommend giving it a go
man, i wish python ffi is coming next...
That's kinda unlikely. Gleam doesn't compile to Python, so it wouldn't make a lot of sense. You'd have to spin up a whole new Python process just to execute the code
@@IsaacHarrisHolt fair enough hhh
What's the reason for wanting a Python backend?
@@IsaacHarrisHolt no particular reason, but i do some research on fastapi this week
tbh it's still better to use a microservice approach if the project needs to be written in multi language
First!
Ffs Lewis 😂
Fifth ?
I don't know how I feel anymore
nth!
I wonder if people ever leave real comments these days...
Fourth!
I give up
Third!
Whyyy 😭😭
Second!
Congrats!