Live data from Hacker News

A Haskell Programmer Tries to Learn Racket

artyom.me

131–140 of 163 posts

Re: A Haskell Programmer Tries to Learn Racket

#131
post #100
post #61

This sums up quite a lot about Lisps in general. I'm amazed OP got so fast to this "insight" :) (And this is probably Lisp's greatest weakness as well – with this level of possible diversity, everyone has to use the “common lowest denominator” simply because nobody can agree on what alternative syntax / library / etc. is better and should be used.) Off-topic: it's not enough to give everyone opportunity to improve th…

I dream of a modular language in which languages, or dialects , can be built from a small base language, which can then be extended, and so on. Of the languages that I've seen, Racket looks the most promising. Forth might be good for this, too, but to build large hierarchies of languages seems the antithesis of Forth - or at least, Chuck Moore's - philosophy. On the other hand, such a language might just end up as an…

Maybe you dream of Rebol?

[http://www.rebol.com/rebolsteps.html]

Re: A Haskell Programmer Tries to Learn Racket

#132
It seems as if several of the author's problems come, oddly for someone who's used both strict (Pascal) and non-strict (Haskell) langauges, from being confused about Racket's strictness. Why is time a special form? Because otherwise (time (expensive)) would just get the result of (expensive). Why doesn't (list 1 (2 3) 4) work? Because list isn't a special form, it's a function. Why doesn't quote turn '(list 1 2 3) into '(1 2 3)? (Well, this one isn't about evaluation order, admittedly.) Because if it did it ... wouldn't be quote.

Re: A Haskell Programmer Tries to Learn Racket

#133
post #121

Earlier quoted context omitted.

I suspect the parent thread was dreaming of a framework where languages with arbitrary syntax can be mixed and matched in user-defined ways. Haskell isn't necessarily that language, partly because it still requires centralized coordination of development of these "extensions" to ensure they're interoperable - that is, there is only one parser for the language and its supported extensions, and many of them are build i…

I don't think the problem stops at syntax. It's possibly an even bigger issue that mixing different language semantics can be awkward. As a big obvious example, a language where all objects are nullable will interface awkwardly with one that only has option types. Similarly, interfacing with something like Smalltalk (which uses methods for flow control) or Forth (which…is Forth) would be awkward from a language that'…

I wasn't implying there is no problem with the semantics, just that it's much easier to deal with when you already have the parsed trees, because they're easier to reason about with code - and we can project them unambiguously.

We already do write tools for such language interoperability for specific pairs of languages, which is often really awkward because it requires us to re-implement the parsers, and only deals with entire code files rather than specific productions in the syntax.

It's pointless composing languages unless it makes sense semantically, which would need to be done on a per-language basis (or per-production rule), which is where I was hinting with using Haskell as the glue for such interoperability - because if we encode the semantics into the type system, such that one syntax expects a language box of type T in it's grammar, then one should be able to use any other language whose parser returns a T, and the semantics will be well-defined for it.

It could also provide the glue for converting between nullable types and option types for example too, by requiring that a language returning a "Nullable T" be wrapped in some function "ToOption", which converts "Nullable T" into "Option T". Attempting to use the Nullable where an Option is expected would fail to parse. How ToOption is implemented is left to the author of the code.

It's much easier to have interoperability between individual production rules in different languages (which share many parts in common) versus "whole text files" which we currently have, which basically require the languages be almost equivalent to convert between them.

Also as a result of storing the semantic information as opposed to sequential text, it would be possible for the user to chose his preferred syntax for any semantic elements in the tree, since they're just working on a pretty-printed version. Most of the concerns about "code style" disappear because they're detatched from the actual meaning that is stored.

Re: A Haskell Programmer Tries to Learn Racket

#134
post #100
post #61

This sums up quite a lot about Lisps in general. I'm amazed OP got so fast to this "insight" :) (And this is probably Lisp's greatest weakness as well – with this level of possible diversity, everyone has to use the “common lowest denominator” simply because nobody can agree on what alternative syntax / library / etc. is better and should be used.) Off-topic: it's not enough to give everyone opportunity to improve th…

I dream of a modular language in which languages, or dialects , can be built from a small base language, which can then be extended, and so on. Of the languages that I've seen, Racket looks the most promising. Forth might be good for this, too, but to build large hierarchies of languages seems the antithesis of Forth - or at least, Chuck Moore's - philosophy. On the other hand, such a language might just end up as an…

[deleted]

Re: A Haskell Programmer Tries to Learn Racket

#135
post #132

It seems as if several of the author's problems come, oddly for someone who's used both strict (Pascal) and non-strict (Haskell) langauges, from being confused about Racket's strictness. Why is time a special form? Because otherwise (time (expensive)) would just get the result of (expensive). Why doesn't (list 1 (2 3) 4) work? Because list isn't a special form, it's a function. Why doesn't quote turn '(list 1 2 3) in…

Pascal is strict, but it still has stuff like “move(var1, var2)”, out parameters, etc., so it's also call-by-reference.

I didn't know at the time that Racket was call-by-value.

Quote was confusing at first, yes.

Re: A Haskell Programmer Tries to Learn Racket

#137
post #68
post #17

Earlier quoted context omitted.

My theories: 1. Using the same programming language on both sides of HTTP often appeals to a developers visceral sense of elegance, or tidiness, even though it this alone inherently solves no existing problems. 2. It's powered by Googles V8 engine, which means people already associate it with this "super fast JIT" thing that lives in their favourite browser. It must be efficient, right? 3. The crowned alternative is…

PHP best practices might be becoming like Java, but the language is far, far, far from anything close as far as I can see. Again, as far as I can see it's as simple to hack together a script in PHP as it ever was. What's changing about the language that makes it more like Java?[1] 1. I tried and failed to make this sentence seem as non-passive-aggressive as possible. I'm genuinely interested, as it's not something I'…

Last I looked it was class definitions and access modifiers that made it look java-esque. I'm not in the know however.

Re: A Haskell Programmer Tries to Learn Racket

#138
post #115

Earlier quoted context omitted.

Such a wonderfully confusing and self-contradictory quote. I love it.

Why do you think it's self-contradictory? I found it fairly stable. I think the most important line for me is about wanting computers to be like lego blocks. I think that's an admirable goal and I think that if Node as a community of programmers and projects owned that more ("We're Mindstorms, not NASA, here!") it'd get a great deal of love from the rest of the community. Sadly, that probably won't happen since Minds…

Here are some of the bits I read as inconsistent.

"Node is popular because it allows normal people to do high concurrency servers." vs "If my job was keeping Twitter up, of course I'd using a robust technology like the JVM." ==> So Node is not actually good for high concurrency servers?

"I want programming computers to be like coloring with crayons and playing with duplo blocks." ==> The wonderful wonderful thing about Duplo is it composes. Continuation-passing style (i.e. callback hell) is the paradigmatic example of a non-compositional whole program transform.

"Node has a large number of newbie programmers." vs "Node is popular because it allows normal people to do high concurrency servers." ==> Newbies are writing high concurrency servers?

"I'm a systems person attempting to make programming better." and "Node is popular because it allows normal people to do high concurrency servers." vs "If my job was keeping Twitter up, of course I'd using a robust technology like the JVM." ==> If Node isn't actually good for its intended use case how exactly are you making programming better?

Re: A Haskell Programmer Tries to Learn Racket

#139
post #115

Earlier quoted context omitted.

Why do you think it's self-contradictory? I found it fairly stable. I think the most important line for me is about wanting computers to be like lego blocks. I think that's an admirable goal and I think that if Node as a community of programmers and projects owned that more ("We're Mindstorms, not NASA, here!") it'd get a great deal of love from the rest of the community. Sadly, that probably won't happen since Minds…

Here are some of the bits I read as inconsistent. "Node is popular because it allows normal people to do high concurrency servers." vs "If my job was keeping Twitter up, of course I'd using a robust technology like the JVM." ==> So Node is not actually good for high concurrency servers? "I want programming computers to be like coloring with crayons and playing with duplo blocks." ==> The wonderful wonderful thing abo…

I guess that I don't feel these so painfully because I don't think Node is necessarily successful at it's goal, though I believe its goal is admirable. CPS might not be the most elegant way to schedule threads, but it is fairly simple which is one kind of boon.

I'm also pretty sure that high concurrency means a variety of things allowing a distinction between Node High Concurrency capability and Twitter High Concurrency need. If Node allows newbies to achieve higher concurrency than other newbie tools (PHP, Rails) then I think it can achieve that task to some degree.

Re: A Haskell Programmer Tries to Learn Racket

#140

Earlier quoted context omitted.

It's ironic that Haskell is such a language: it grows from a tight, small core into larger and greater abilities as you learn it even without using its extensions. I agree that Common Lisp a very powerful language, but I can't live with all that power uncontrollably thrown on me. Common Lisp grossly lacks self-discipline and self-limitation when it's needed.

Ugh, please let Common Lisp be. There's enough bondage & discipline languages already so it is nice to have CL on the opposite side of the spectrum.

Why would anyone need CL when we have JavaScript?! I think the latter has even less bondage & discipline in it.
Post reply on HN