Live data from Hacker News

Loop: a programming language for the JVM inspired by Haskell and Ruby

looplang.org

31–40 of 41 posts

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#31
post #21
post #11

Earlier quoted context omitted.

Pattern-matching is not sugar over "case". Pattern-matching means that the branching primitive not only dispatches to different code based on an input tag, but also that it places different values of different types in scope according to the branch. Most languages only branch on booleans, without gaining any type information at all. This is actually a big problem and relates to the nullability problem, explained at:…

Well, he could be talking about reverse [] = [] reverse (x:xs) = reverse xs ++ [x] being sugar for reverse list = case list of [] -> [] (x:xs) -> reverse xs ++ [x] Since in that case, pattern matching on arguments is really just sugar for a case statement.

case is pattern-matching, though.

He said pattern-matching was sugar for "case/switch construct present in many, many languages". That implies pattern-matching adds only syntax to the game, and that it doesn't add any useful things beyond the "switch" you find in C or Java, for example.

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#32
Thanks a lot for sharing this - particularly the full source code of your implementation. It looks very clean and well written.

I personally like that you wrote your own recursive descent parser and lexer rather than using some tool to generate one. This is my preference too.

The result is that the source code makes for a great reference for anyone thinking of implementing a language on top of the JVM.

Pay no heed to the "bah humbug" comments elsewhere on this story - I think what you've done is great.

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#36
You have done one thing _very_ good -- Good intro page.

Now have pages for differences with language X, and it will not only clarify your thinking but also what one can expect from a language.

After that have a cookbook and a web-framework and your ready to go the full-monty !

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#37
post #15

> Polymorphism in this instance is simply allowing you to call the same function with an integer and string respectively. Er... no, that's not polymorphism, that's overloading.

In computer science, polymorphism is a programming language feature that allows values of different data types to be handled in a uniform manner. This may be ad hoc polymorphism (often synonymous with overloading) - or parametric polymorphism (as in ML or Haskell); but it's unclear what they actually do without some language semantics.

And to be more complete, OO-style polymorphism is usually referred to as "subtype polymorphism" and the parametric polymorphism dons talked about is like C++ or Java "generics"

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#38
post #20

I take issue with Haskell programmers may be familiar with this as a do block, and for Schemers, this is the equivalent of a begin sequence. However, unlike Haskell, in Loop, a sequence is guaranteed to execute in order. A do block is syntactic sugar over >>= (bind) and is monadic in nature. And the IO monad (which is relevant to the example that involved printing things.) is a construct which guarantees that the par…

[deleted]

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#39
post #31
post #21

Earlier quoted context omitted.

Well, he could be talking about reverse [] = [] reverse (x:xs) = reverse xs ++ [x] being sugar for reverse list = case list of [] -> [] (x:xs) -> reverse xs ++ [x] Since in that case, pattern matching on arguments is really just sugar for a case statement.

case is pattern-matching, though. He said pattern-matching was sugar for "case/switch construct present in many, many languages". That implies pattern-matching adds only syntax to the game, and that it doesn't add any useful things beyond the "switch" you find in C or Java, for example.

I was looking for a forgiving interpretation of his statement. It's better to assume someone is right, and a little unclear, then just outright wrong.

Re: Loop: a programming language for the JVM inspired by Haskell and Ruby

#40
post #39
post #31

Earlier quoted context omitted.

case is pattern-matching, though. He said pattern-matching was sugar for "case/switch construct present in many, many languages". That implies pattern-matching adds only syntax to the game, and that it doesn't add any useful things beyond the "switch" you find in C or Java, for example.

I was looking for a forgiving interpretation of his statement. It's better to assume someone is right, and a little unclear, then just outright wrong.

Sure, and I'd do the same if he said it was just sugar over "case", but he explicitly said "case/switch found in many languages", which makes it pretty definite IMO.
Post reply on HN