isUpperStart : String -> Bool
isUpperStart name =
case String.slice 0 1 name of
"A" ->
True
"B" ->
True
"C" ->
True
... for 23 more cases.
And the corresponding go code in the bootstrap compiler is even worse.Sky – an Elm-inspired language that compiles to Go
31–40 of 99 posts
Re: Sky – an Elm-inspired language that compiles to Go
#32Earlier quoted context omitted.
What was the other one? I'm working on a language that transpiles to Zig with a custom Go-like runtime (and no garbage collector, Rust-style Affine movement instead). Sky seems quite cool, as it's additive to Go in interesting ways. I originally considered keeping the GC and just transpiling to Go so I didn't need to write a Runtime. Go rules! It really does. But I HATE writing/reading Go. So I'm glad more people are…
https://lisette.run/
Re: Sky – an Elm-inspired language that compiles to Go
#33Great work :). Go doesn't have TCO. That means functional languages (no for loops) could blow up the stack. How did you solve that?
You can just compile any tail recursive function to a function with a loop and no recursion.
If the function can be written as an idiomatic loop I probably would do so in the first place.
Re: Sky – an Elm-inspired language that compiles to Go
#34Nice to see another language with Haskell / Miranda type syntax, but the vibe-coded implementation sure shows: e.g. src/Compiler/Infer.sky isUpperStart: isUpperStart : String -> Bool isUpperStart name = case String.slice 0 1 name of "A" -> True "B" -> True "C" -> True ... for 23 more cases. And the corresponding go code in the bootstrap compiler is even worse.
Re: Sky – an Elm-inspired language that compiles to Go
#35First - awesome job. Congrats. Self hosting is an accomplishment! But I'm curious to get your thoughts on the process in hindsight. I understand why it's valuable: to cast a wide net in catching bugs and give a good signal that your language is generally "ready". I'm working on a similar language, but worried about going down the self-hosting path, as I think it'd slow me down rather than speed me up. How did it work…
Re: Sky – an Elm-inspired language that compiles to Go
#36Functional languages have some good and some bad features and there's no reason to copy them all. For example, you don't need to have a Hindley-Milner type system (bidirectional is better) or currying just because it's a functional language.
We need more pragmatic languages. E.g. Erlang and Elixir are functional, but eschew all the things FP purists advocate for (complex type systems, purity, currying by default etc.)
Re: Sky – an Elm-inspired language that compiles to Go
#37First - awesome job. Congrats. Self hosting is an accomplishment! But I'm curious to get your thoughts on the process in hindsight. I understand why it's valuable: to cast a wide net in catching bugs and give a good signal that your language is generally "ready". I'm working on a similar language, but worried about going down the self-hosting path, as I think it'd slow me down rather than speed me up. How did it work…
What's the actual accomplishment here? It seems like the language came into existence a month ago and was written mostly by Claude. If self hosting is a matter of asking Claude to do it and it takes a couple weeks, is it really an accomplishment at all?
Re: Sky – an Elm-inspired language that compiles to Go
#38First - awesome job. Congrats. Self hosting is an accomplishment! But I'm curious to get your thoughts on the process in hindsight. I understand why it's valuable: to cast a wide net in catching bugs and give a good signal that your language is generally "ready". I'm working on a similar language, but worried about going down the self-hosting path, as I think it'd slow me down rather than speed me up. How did it work…
What's the actual accomplishment here? It seems like the language came into existence a month ago and was written mostly by Claude. If self hosting is a matter of asking Claude to do it and it takes a couple weeks, is it really an accomplishment at all?
Go's runtime is one of the greatest pieces of software ever built.
Assuming this works - which self-hosting guarantees a minimum level of "working" - this is useful!
I didn't want to rely on the unpredictability of a garbage collector, so I chose to build my own runtime, but it's not going to be as good as Go any time soon.
Re: Sky – an Elm-inspired language that compiles to Go
#39Nice to see another language with Haskell / Miranda type syntax, but the vibe-coded implementation sure shows: e.g. src/Compiler/Infer.sky isUpperStart: isUpperStart : String -> Bool isUpperStart name = case String.slice 0 1 name of "A" -> True "B" -> True "C" -> True ... for 23 more cases. And the corresponding go code in the bootstrap compiler is even worse.
Haskell/Miranda use `::` instead of `:` for type signatures unlike Elm & basically the rest of the family which prioritize types being less keypresses than list cons.
Re: Sky – an Elm-inspired language that compiles to Go
#40That's two new languages compiling to Go making HN frontpage in as many days. It seems people like everything about Go except the language itself. Me? I like everything about Go including the language, these transpiled languages are interesting though. But I keep wondering if they could integrate at a lower-level than the source code. Like how JVM languages integrate at the bytecode level, or LLVM languages at the LL…