Live data from Hacker News

Rhombus Language

rhombus-lang.org

41–50 of 161 posts

Re: Rhombus Language

#41

Is it possible to have Hindley–Milner type system for a LISP?

I don't know what Hindley-Milner means, but maybe Coalton matches what you mean? https://github.com/coalton-lang/coalton>

Re: Rhombus Language

#42
post #6

From the 2nd example: class Rect(left, top, right, bottom) fun rect_like_to_rect(v): match v | Rect(_, _, _, _): v | {"LT": [l, t], "RB": [r, b]}: Rect(l, t, r, b) | {"TL": [t, l], "RB": [b, r]}: Rect(l, t, r, b) rect_like_to_rect({"TL": [0, 2], "RB": [10, 5]}) // ⇒ Rect(0, 2, 10, 5) Isn't this wrong? I'd expect to see Rect(2, 0, 5, 10) instead. It also seems like "RB" was meant to be "BR".

If you indent each line by, uh, something (I use 4 spaces), HN gives you code formatting:

    class Rect(left, top, right, bottom)
                         
    fun rect_like_to_rect(v):
      match v
      | Rect(_, _, _, _): v
      | {"LT": [l, t], "RB": [r, b]}: Rect(l, t, r, b)
      | {"TL": [t, l], "RB": [b, r]}: Rect(l, t, r, b)
                                    
    rect_like_to_rect({"TL": [0, 2], "RB": [10, 5]})
    // ⇒ Rect(0, 2, 10, 5)
    rect_like_to_rect({"LT": [0, 2], "RB": [10, 5]})
    // ⇒ Rect(2, 0, 5, 10)
Not sure about the typo though, just wanted to make the code readable here since showing off code in the language being talked about is helpful.

Re: Rhombus Language

#43

I am going to play the devil's advocate. What problem does Rhombus solve? An approachable syntax is a necessary, but not sufficient requirement for mass adoption. According to the goals page, its other major feature is an extensible syntax. Why should I prefer it over, say, Scala? Scala has syntax macros, it runs on the JVM and can access Java's massive library of libraries, it has been used to implement large and co…

> Many newer languages include a macro system to enable extensibility, but few would argue that the new batch of macro systems have achieved the expressiveness and fluidity of macros as they exist within the Lisp tradition, which includes Racket. It sounds like the authors see Lisp-style macros as uniquely powerful and are exploring how to bring similar meta-programming power to languages with syntax other than just…

Add to this integration with an entire family of languages. Racket permits you to jump between different syntaxes. The closest thing that immediately comes to mind is writing inline C in Chicken or Gambit Scheme and that's far clunkier. Hy (embeds in python) also comes to mind but Python often seems rather slow.

Re: Rhombus Language

#44
post #29
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…

TypeScript & Rust don't "look nice to work with" because they force you to write maintainable code that doesn't just stop working because of a random runtime error. In my opinion, Go looks nice to work with but actually is a hidden monster full of footguns.

Curious to read that because I’ve always had the opposite opinion of the above:

Typescript looks nice to work with but the tool chain is horrible (this isn’t really Typescripts fault though, more a synonym of it having to compile to JS).

Go looks horrible to work with (too simplified syntax) but is actually really nice because the tooling is (mostly) spot on and it’s simplified syntax weirdly helps with maintainability for large projects that have evolved over multiple years.

I guess this just goes to show how much personal preference can be a driving force behind our platforms of choice.

Re: Rhombus Language

#45
post #29
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…

TypeScript & Rust don't "look nice to work with" because they force you to write maintainable code that doesn't just stop working because of a random runtime error. In my opinion, Go looks nice to work with but actually is a hidden monster full of footguns.

Technically TypeScript doesn’t force you to anything other than writing valid JS code. Its design was great for wide adoption but also suffers from the JS part.

Re: Rhombus Language

#46
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 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.

TypeScript suffers too much from being a JS superset. JS has horrendous DX imho.

Re: Rhombus Language

#47
post #29
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…

TypeScript & Rust don't "look nice to work with" because they force you to write maintainable code that doesn't just stop working because of a random runtime error. In my opinion, Go looks nice to work with but actually is a hidden monster full of footguns.

Exactly, Typescript doesn't stop working because of random runtime errors, it stops working because you didn't update the toolchain tangle last Thursday and then some configuration file got out of whack with the tsc defaults ;-)

Re: Rhombus Language

#48
post #15

Earlier quoted context omitted.

What is the relation to Haskell? The language is basically Racket, which is a Scheme at its core. There's very little in common with a language like Haskell.

Syntax-wise it looks a lot like Haskell to me, especially the pattern-matching, the variable declarations (with `::`), as well as the indent-based blocks.

It's usually called ML-syntax. SML, OCaml, Elm, PureScript, and many more have used this.

Re: Rhombus Language

#49
post #15

This actually looks good. It's like a less-obtuse Haskell. At a glance the features seem to be just the right mix of functional programming paradigms and standard imperative programming.

What is the relation to Haskell? The language is basically Racket, which is a Scheme at its core. There's very little in common with a language like Haskell.

> What is the relation to Haskell?

I could only think of is they are both being a "typed lambda calculus" language with an ML-syntax.

Re: Rhombus Language

#50
post #41

Is it possible to have Hindley–Milner type system for a LISP?

I don't know what Hindley-Milner means, but maybe Coalton matches what you mean? https://github.com/coalton-lang/coalton >

It's static typing with inference. Essentially what you have in Haskell/OCaml/F# where you declare a variable `x` through a let-binding witout specifying its type (`let x = something`), and the compiler analyses `something` and infers the type of `x`.
Post reply on HN