Live data from Hacker News

Sky – an Elm-inspired language that compiles to Go

github.com

91–99 of 99 posts

Re: Sky – an Elm-inspired language that compiles to Go

#91
post #81

Earlier quoted context omitted.

> Go unwillingness to add even the most simple enum kind of type. Go has enums, under the iota keyword. But I imagine you are really thinking of sum types. Technically Go has those too, but must always have a nil case, which violates what one really wants out of sum types in practice. Trouble is that nobody has figured out how to implement sum types without a nil/zero case. That is why you haven't seen a more well-ro…

For example if a have a type with 3 constuctors, and later one new dev adds one more case and forgets to handle it in every call site. No test will catch this 100%, but something like ocaml will just by compiling the program. I know fo is not (i dont want it to be) like ocaml, bit any modern language should have some of the basic safety features baked in.

[deleted]

Re: Sky – an Elm-inspired language that compiles to Go

#92
post #81

Earlier quoted context omitted.

> Go unwillingness to add even the most simple enum kind of type. Go has enums, under the iota keyword. But I imagine you are really thinking of sum types. Technically Go has those too, but must always have a nil case, which violates what one really wants out of sum types in practice. Trouble is that nobody has figured out how to implement sum types without a nil/zero case. That is why you haven't seen a more well-ro…

For example if a have a type with 3 constuctors, and later one new dev adds one more case and forgets to handle it in every call site. No test will catch this 100%, but something like ocaml will just by compiling the program. I know fo is not (i dont want it to be) like ocaml, bit any modern language should have some of the basic safety features baked in.

> later one new dev adds one more case and forgets to handle it in every call site

Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable?

I accept you like to live dangerously and have no real care for the product you are building. But, still, you've only covered a limited subset of all the similar things this new developer who doesn't know the first thing about building software can make a mess of. Ocaml just isn't going to cut it.

To reach the full gamut you need, say, a proper dependent type system. But are you really going to throw all your Ocaml code away and start writing Rocq just to deal with this guy you should have never let touch your code in the first place? Probably not. So, what now? Your only practical option is to fire him and find someone who actually understands how to write software. And at that point your tests will catch such forgetfulness just fine.

> No test will catch this 100%

Testing cannot exhaust all cases where the search space is infinite as that requires infinite time to evaluate. In this case, you have exactly 4 states. That is evaluated on the order of nanoseconds. If your tests are not capturing every one of those four permutations, it seems clear that you need to stop letting any random Joe who has never done more than some quick vibe coding anywhere near your code. These are solved problems.

And, hell, even if you did switch to a language with a proper type system, like Rocq, so you could mathematically guarantee all aspects of your program, the shitty programmer will still fail to write theorems that are free of holes. So don't think that even lets you of the hook in hiring those who live by the vibes. There is simply no escaping the need for solid engineering.

When you have that, exhaustiveness checking still remains a useful tool, but you aren't going to forget something and ship broken code to production if you don't have it. This isn't a realistic scenario outside of the contrived. Again, The construct is useful enough that you don't need to oversell it on imagined hypotheticals.

Re: Sky – an Elm-inspired language that compiles to Go

#93
post #2

at first glance this looks amazing! basically provides everything I have ever wanted in a full stack language. looking forward to experimenting with it. edit: looking through the docs/examples some more, it looks like javascript interop is fairly clunky, both because it relies on string concatenation to embed fragments of javascript, and because the string concatenation syntax is not great (and the formatter makes it…

Thanks for taking your time to look at the repo! yes I have built so many applications and worked at startups/scaleups where different languages / type systems are used for frontend/backend, and very often we need to bring in schema generation like OpenAPI, protobuf/connectrpc etc. to code generate types/apis that can be shared between teams. But that's ugly and hard to maintain & scale.

I love Elm's ergonomics & Go's simplicity, and Sky is really my serious take to bring 1 language for full stack application (well, at least to cater for most common application types).

back to your feedback, indeed, the multi-line string is one of the things that bug me as well. They only surface when I start building incremental examples -- skyshop is a realworld like example which expose a bunch of issues & compiler limitations.

That said, my goal is for devs not needing to write/embed JS in Sky code, but perhaps serve as static, and have Sky semantic to "load/init" the JS.

Nonetheless the ugly multi-line string issue is now addressed with https://github.com/anzellai/sky/pull/13.

HTML I took similar of Elm to have elements as function, and have an escape hatch using node for custom elements. I use VNode rather than string for HTML rendering, as that's much more efficient in diffing and for Sky.Live SSE push for updates.

Anyhow, please feel free to check on Sky repo regularly and hopefully I will make enough progress sooner that Sky is useable in realworld side projects.

Re: Sky – an Elm-inspired language that compiles to Go

#94
post #75

Keeps saying "no websocket required" like it's a good thing. The JS client ( https://github.com/anzellai/sky/blob/main/docs/design/sky-li... ) seems to rely on long polling. Phoenix LiveView (the inspiration) defaults to using WebSockets because it's much more efficent, but falls back to Long polling if not available.

[dead]

Re: Sky – an Elm-inspired language that compiles to Go

#95
post #92

Earlier quoted context omitted.

For example if a have a type with 3 constuctors, and later one new dev adds one more case and forgets to handle it in every call site. No test will catch this 100%, but something like ocaml will just by compiling the program. I know fo is not (i dont want it to be) like ocaml, bit any modern language should have some of the basic safety features baked in.

> later one new dev adds one more case and forgets to handle it in every call site Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable? I accept you like to live dangerously and ha…

> Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable?

Tell me without telling me you have never worked on a large scale business app.

Re: Sky – an Elm-inspired language that compiles to Go

#96
post #92

Earlier quoted context omitted.

> later one new dev adds one more case and forgets to handle it in every call site Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable? I accept you like to live dangerously and ha…

> Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable? Tell me without telling me you have never worked on a large scale business app.

I did long enough to know that in large teams you won't find many accepting of usable type systems. For the same reason the blub developer cannot write good tests, if they can figure out how to write tests at all, they equally fail with types. Which makes sense — testing and types try to solve the exact same problem. The mindset required to grasp and be productive with both is identical. So your imagined hypothetical doesn't even work there. These large scale apps of which you are speak are simply built around constant failure in production. If it is good enough for GitHub...

The only place where the your contrived idea is in any way plausible is where you have a solo developer who thinks he is able to write code without making mistakes or needing to document anything, using a half-assed type system not failing as some kind of proof to himself of that. But in reading this he, unless the hubris is completely off the charts, will be reevaluating that stance.

Re: Sky – an Elm-inspired language that compiles to Go

#97
post #2

at first glance this looks amazing! basically provides everything I have ever wanted in a full stack language. looking forward to experimenting with it. edit: looking through the docs/examples some more, it looks like javascript interop is fairly clunky, both because it relies on string concatenation to embed fragments of javascript, and because the string concatenation syntax is not great (and the formatter makes it…

Thanks for taking your time to look at the repo! yes I have built so many applications and worked at startups/scaleups where different languages / type systems are used for frontend/backend, and very often we need to bring in schema generation like OpenAPI, protobuf/connectrpc etc. to code generate types/apis that can be shared between teams. But that's ugly and hard to maintain & scale. I love Elm's ergonomics & Go'…

awesome! will definitely check back regularly.

Re: Sky – an Elm-inspired language that compiles to Go

#98
post #96

Earlier quoted context omitted.

> Okay, so you are dreaming of a situation where you allow a new developer who doesn't know anything about how to engineer software unfettered access to your codebase and he goes in and starts mucking about to where he ends up doing things that no sensible human would ever consider acceptable? Tell me without telling me you have never worked on a large scale business app.

I did long enough to know that in large teams you won't find many accepting of usable type systems. For the same reason the blub developer cannot write good tests, if they can figure out how to write tests at all, they equally fail with types. Which makes sense — testing and types try to solve the exact same problem. The mindset required to grasp and be productive with both is identical. So your imagined hypothetical…

> you won't find many accepting of usable type systems

I think its not about the "typesystem" but the fear of using something the dev is unfamiliar with. I know people who has written the same code, in the same language for 20+ years. "It worked then, and it will work now" is tattooed on their forehead. Its basic human behaviour, you see this in politics, business and life in general.

> testing and types try to solve the exact same problem

Sure, they overlap.

Tests are just a poor mans types, Types are just a poor mans tests

But in my mind tests cover the how, and types the what. With both you need less of both. Its a win-win.

> These large scale apps of which you are speak are simply built around constant failure in production.

This is true. But im going to my grave trying to change that. Its an uphill battle.

Re: Sky – an Elm-inspired language that compiles to Go

#99
post #85
post #83

Earlier quoted context omitted.

You're missing Derw from that list: https://www.derw-lang.com/ . Predates all the others, and is from a former core team member (me). I'm also the author of server-side Elm experiment known as [take-home]( https://github.com/eeue56/take-home ) from 11 years ago. I can see a lot of patterns in Sky's codebase which seem trained on Derw's codebase. Also authored the first Elm-in-Elm compiler for a limited subset for jso…

I KNEW I forgot one. I'm really sorry. This list was off the dome and I was hoping to hit a Cunningham's law situation (which I did) without making anyone feel left out (which I failed).

Commenting so I remember the next time I copy and paste this comment: the error messages in Rust since 2016 https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-com...
Post reply on HN