#full-stack applications in gleam

1 messages · Page 1 of 1 (latest)

astral sun
#

hello!!
when i first saw gleam i felt like the potential for a language to compile to both js and erlang made it the perfect language for web apps

looking into it however, i saw this on the lustre docs:

Although Gleam supports multiple targets, and has conditional compilation features, the language isn’t designed to support a single codebase with different applications for different targets. Instead, we will create three separate Gleam projects

i was wondering if this is a hard limitation of the language, an intentional choice? is this something that can be helped?

raven dew
#

what's the problem?

winged dagger
#

@astral sun it's pretty typical (and clean) to just have 2 gleam projects in your repo. One for the server and another for the client. If you need to share types you can have a third, that's it.

astral sun
#

i understand that! if i were making a web app i would also do it this way, but what im curious about is this line in particular:

the language isn’t designed to support a single codebase with different applications for different targets

my question is more about the language itself, what does it mean for gleam to "not be designed to support" this? where does this come from?

raven dew
#

the way targets work in gleam means you cannot have a single project with code that only compiles for one target

#

because when you try to compile for the other target it will error, this is how gleam is intentionally designed: no conditional compilation here!

astral sun
#

ahh gotcha! that makes sense

#

i was wondering if it would be possible to make a railsy framework with gleam