Live data from Hacker News

Perchance to Scheme (2016)

hardmath123.github.io

41–50 of 82 posts

Re: Perchance to Scheme (2016)

#41
post #39

> Clojurescript.... Personally, I don’t like it on a matter of principle: I don’t like things that compile to JavaScript. It doesn’t seem like anything you really need to write better code. Maybe I don't understand what the alternative is when you want to write client side code for the browser - js?? I use Clojurescript and find clear benefits. By way of example I often found the general setTimeout functionality to b…

What was your experience with Racket?

This dates back about 5 years ago, but I found Racket's libraries were rough. Often they amounted to prototype work that never got fleshed out, they were ill maintained, low in quality, and many just wouldn't load. And these were general purpose libraries; like even just basic database stuff.

I moved on to Clojure.

Re: Perchance to Scheme (2016)

#42

Alternatively - you can choose to program in Common Lisp - an industrial strength language that has been demonstrated in large projects like the QPX flight search engine (Google Flights). For anyone who doesn't know - a big difference that Common Lisp brings to the table is that it has separate namespaces for variables and functions. This may not sound like much but it makes it much easier to write macros (code that…

> a big difference that Common Lisp brings to the table is that it has separate namespaces for variables and functions. This may not sound like much but it makes it much easier to write macros (code that writes code) and facilitates compile-time computing.

A little more detail here: it has a lot more namespaces than that. Indeed, you can attach arbitrary different namespaces of things to symbols if you want to.

It turns out that when you're writing macros in Lisp, the majority of what you use from outside the macro are functions and the majority of symbols that you bind and use within the macro are variables, so if you put them in different namespaces, you get rid of the majority of cases where symbols don't do what you were expecting in a macro.

Now, it's not quite all of the cases, and when it does happen, it's a pain to track down. Which is why the Scheme folks spent the effort and complexity on hygienic macros (where the system rewrites all symbols internally to make variable capture impossible). At the time of Common Lisp's creation, multiple namespaces and unhygienic macros were the obvious choice for production code, since there weren't hygienic systems available. Today you can go either way. In terms of research, hygienic is the route to go, as the work over the last couple of years on strongly typed, hygienic systems has shown.

Re: Perchance to Scheme (2016)

#43
post #9

Earlier quoted context omitted.

Not a R6RS fan myself, so no definitive answer. But AFAIK Chez (now open source as someone else posted) is R6RS-compliant and one of the fastest implementations. Also, R7RS-small is final I think. Not sure about R7RS-large. Here's an old discsussion: https://news.ycombinator.com/item?id=11700167 .

I think Chicken Scheme recently became r7rs in their new version 5

Chicken R7RS is still a work in progress AFAIK

Re: Perchance to Scheme (2016)

#45
post #31

Racket is not academic to me. Racket equals programming fun and really is a joy to use. Academic seems to not convey the feeling one gets when using Racket. To me Racket is really the future of what languages will look like, a language to create your own DSL. The greatest strength of Racket is its documentation. Secondly the way Racket actually teaches you how to be a better programmer. I personally grew the most due…

I used to be very much anti-Racket, until I grasped the reality that it is not a Scheme, but a Scheme-derived language that strives to combine power and rational design. I now use it daily for many pet projects, and it is great: highly effective, predictable, well-documented, and supplied with enough libraries that you can go a while in most projects before you need to implement anything outside what is core to your purpose. The ffi isn't as bad as the article suggests, either.

Re: Perchance to Scheme (2016)

#46
post #31

Racket is not academic to me. Racket equals programming fun and really is a joy to use. Academic seems to not convey the feeling one gets when using Racket. To me Racket is really the future of what languages will look like, a language to create your own DSL. The greatest strength of Racket is its documentation. Secondly the way Racket actually teaches you how to be a better programmer. I personally grew the most due…

> Racket equals programming fun and really is a joy to use. Academic seems to not convey the feeling one gets when using Racket.

As an academic, it makes me very sad to hear these qualities, that I feel describe my work, used as the opposite of 'academic'.

Re: Perchance to Scheme (2016)

#48
post #32

As a guile user myself, I feel I must say that guile works just fine also when you are not embedding it. It is a very capable scheme, and even though it is not as fast as chez or racket, things have gotten a lot better (the upcoming JIT in the 3.0 release means at least a 2x speedup).

Oh,and thanks to pthreads and guile fibers the concurrency situation is probably the best of any scheme.

Re: Perchance to Scheme (2016)

#49

Alternatively - you can choose to program in Common Lisp - an industrial strength language that has been demonstrated in large projects like the QPX flight search engine (Google Flights). For anyone who doesn't know - a big difference that Common Lisp brings to the table is that it has separate namespaces for variables and functions. This may not sound like much but it makes it much easier to write macros (code that…

> a big difference that Common Lisp brings to the table is that it has separate namespaces for variables and functions. This may not sound like much but it makes it much easier to write macros (code that writes code) and facilitates compile-time computing. A little more detail here: it has a lot more namespaces than that. Indeed, you can attach arbitrary different namespaces of things to symbols if you want to. It tu…

> A little more detail here: it has a lot more namespaces than that.

And I don't think the function/value split is even the most important namespacing it does with regards to macro hygiene ("functions are less likely to be shadowed" always struck me as a kind of weak argument). Symbols being namespaced under packages is a much more robust solution:

    CL-USER> (defmacro m (x) `(car ,x))
    M
    CL-USER> (defpackage :p)
    #
    CL-USER> (in-package :p)
    #
    P> (cl:macroexpand '(cl-user::m x))
    (COMMON-LISP:CAR X)
CL:CAR isn't accessible in P, so (car x) by itself would signal UNDEFINED-FUNCTION, but the macro works correctly. Defining a P::CAR function wouldn't change anything.

That isn't just for functions, either, eg if you do:

    (defmacro awhen (pred &body body)
      `(let ((it ,pred))
         (when it ,@body)))
(where you want to leak IT), and then import AWHEN but not IT, you'll get an error that YOUR-PACKAGE::IT isn't bound to anything when you try to use it; it doesn't matter that AWHEN-PACKAGE:IT is bound.

I don't disagree with anything you said, I just think it made CL macros look flimsier than they are.

Re: Perchance to Scheme (2016)

#50
post #23

There's this new implementation called "gerbil"[1] which runs on top of gambit, is still very young but looks very promising. It's opinionated in a good way (IMHO). [1]. https://cons.io/

Looking at it, I'd call it a new language, not a Scheme implementation. Its semantics are much different from Scheme's.
Post reply on HN