Live data from Hacker News

Rhombus Language

rhombus-lang.org

131–140 of 161 posts

Re: Rhombus Language

#131

I have used Racket in production for a decade and a half, with great success. Racket belongs to a sort of invasive species equivalent in languages, in the sense that once it has a hold on you, all other languages, old and new, vanish from your mind. The elegance of Scheme married with the power of hygienic macros does a great job at tricking your mind into believing Paul Graham's Hundred-Year Language idea again. Wha…

Can you tell me more about what you're building with Racket? Warms my heart to hear about/see Racket being used in production.

Re: Rhombus Language

#132
post #18

The examples on the home page are a nice way to quickly show the features of a language. I'll check the documentation to see how to work with files, make HTTP calls, parse JSON. It's the first time in more than 10 years that I actually feel like trying a new language. The last time was Elixir. Since then I had to use Lua (hobby project) and Python (work) but I don't enjoy them much. I would have skipped them if I had…

I was skeptical when I heard “Python-like Racket syntax,” but this certainly looks like the Python I wish I was writing. Edit: racket is a nice language, went my thinking, why give it a Python syntax? But I think they’ve answered that.

I think they say "Python-like syntax" because "ML-like syntax" is too big a turnoff ;)

Re: Rhombus Language

#133

Earlier quoted context omitted.

When the pattern `[Posn(x, y), ...]` matches a list of positions, since `Posn(x, y)` is followed by `...` the `x` is bound to a sequence of first coordinates and `y` is bound to a sequence of second coordinates. In the template the `Posn(y, x)` is followed by `...` so the same number of positions is produced as the common length of x and y.

What would be the corresponding syntax for matching and flipping only the first Posn? If I had to guess: fun flip_all([Posn(x, y), rest]): [Posn(y, x), rest] If I am correct then the only difference between flipping all and flipping just the first is `...` vs `rest`

    fun flip_first([Posn(x, y), more, ...]):
      [Posn(y, x), more, ...]

Re: Rhombus Language

#134
post #27

How hard would it be to uniquely extend the language to make *fun* into *fn* and *...* into a single letter *…*? fun all_same([str0, str, ...]): all(str0 == str, ...)

The easiest way would be to rename the imported names

  #lang rhombus
  
  import rhombus:
    only: fun ...
    rename fun as fn
    rename ... as …
    open

  fn all_same([str0, str, …]):
    all(str0 == str, …)

Re: Rhombus Language

#135

Earlier quoted context omitted.

I’m not sure about Go being full of footguns, but for one, a panic in any goroutine forcibly terminates the entire application.

I think that's the intention of a panic.. however there is still recover if you need to "catch" it.

The issue is you need to explicitly recover each goroutine just so a nil dereference or a panic from a library you have no control over doesn’t bring down the whole application. Maybe this is the way it has to be, but it is a little known fact that might bite you.

Re: Rhombus Language

#136

I have used Racket in production for a decade and a half, with great success. Racket belongs to a sort of invasive species equivalent in languages, in the sense that once it has a hold on you, all other languages, old and new, vanish from your mind. The elegance of Scheme married with the power of hygienic macros does a great job at tricking your mind into believing Paul Graham's Hundred-Year Language idea again. Wha…

Can you tell me more about what you're building with Racket? Warms my heart to hear about/see Racket being used in production.

The last app I worked on was an advanced Harmony/Flow(ex-shotgrid) bridge which let production staff manage Flow's database, upload assets and work on scenes without having to deal much with Flow's horrible UI. Over the years I have written hundreds of small tools to automate production and assist artists with their workflows in Harmony. Racket's built in UI library and supremely maintainable syntax made it very easy and fun to work with. I published quite a few apps and tools of variable quality at https://github.com/dexterlagan

Re: Rhombus Language

#137
post #119
post #86

Earlier quoted context omitted.

I’ve used it for all kinds of production stuff over the years, from web to desktop and mobile apps.

Interesting, how do you distribute/publish those apps?

Web: create an executable distribution[1] and ship it to a server.

Windows/Linux/macOS: same as web, using cross-compilation[5]. Additionally for macOS, embedded in a Swift app and distributed as a .dmg[2] and on the Mac App Store[3]

iOS: embedded in a Swift app and distributed on the App Store[4].

[1]: https://docs.racket-lang.org/raco/exe-dist.html

[2]: https://franz.defn.io/

[3]: https://apps.apple.com/us/app/franz-apache-kafka-client/id64...

[4]: https://apps.apple.com/us/app/podcatcher-podcast-player/id67...

[5]: https://docs.racket-lang.org/raco-cross/index.html

Re: Rhombus Language

#138

Earlier quoted context omitted.

I think that's the intention of a panic.. however there is still recover if you need to "catch" it.

The issue is you need to explicitly recover each goroutine just so a nil dereference or a panic from a library you have no control over doesn’t bring down the whole application. Maybe this is the way it has to be, but it is a little known fact that might bite you.

The only time a library should be panicking is if they’ve reached a state they cannot continue from.

I’d be interested to know which libraries you’re working with where this has been a problem because I’ve only ever experienced one occasion where a 3rd party library panicked unnecessarily.

Re: Rhombus Language

#139
post #46

Earlier quoted context omitted.

I found Kotlin a "typed Ruby" (I found Ruby a "sane Perl"). Rust seems pretty nice to work with (good DX) in it's domain: close to the metal programs were every tick counts. The main DX issue with it would be compile times. Go's awful to me from a DX perspective as it is lacks proper error handling. Compile times are great though. Maybe OCaml is a good fit for me (and you!). Fast compile times and good error handling…

Did you ever see Crystal? It's more or less a typed Ruby. I've heard that you can port some code directly. https://crystal-lang.org/

YesI have. But I need to get work done so I rather use a language with a larger ecosystem.

Also, I've come to prefer more FP.

Re: Rhombus Language

#140
post #79

Earlier quoted context omitted.

After 20 years of Ruby I didn't know (or didn't remember) that next can have an argument. I looked it up. Thanks. BTW, I never liked the _N arguments. Too cryptic. They make me stop and think on details instead of just read the code and concentrate on the important stuff. x.map {¦n¦ n + 3}.sum is immediately clear but I guess that it's very subjective.

In 3.4 you can now do x.map { it + 3 }.sum which I'm still getting used to

You also find `it` in Kotlin.
Post reply on HN