Live data from Hacker News

A Friendly Introduction to Racket

geometridae.bearblog.dev

61–70 of 195 posts

Re: A Friendly Introduction to Racket

#61
post #59

Earlier quoted context omitted.

Homoiconicity makes writing macros easy. If you don't like it, you can try https://rhombus-lang.org/ that is build on Racket and also has macros but uses a Python-like syntax.

Easy is an understatement. Macros and dynamic programming (often done using runtime reflection in other languages) are so trivially easy in Lisps that one can stumble into it without realizing they're even doing it. Anyone who has done these things in more "modern" languages knows these features are not something one can accidentally start doing. They take a lot of deliberate effort relative to standard, static progr…

> Easy is an understatement. Macros and dynamic programming (often done using runtime reflection in other languages) are so trivially easy in Lisps that one can stumble into it without realizing they're even doing it.

Well, getting the interaction between modules and syntax transformations (macros) right is not an easy task.

"Composable and Compilable Macros: You Want it When?" Matthew Flatt http://dl.acm.org/authorize?24908

Re: A Friendly Introduction to Racket

#62

Earlier quoted context omitted.

> Wtf kind of intro to a programming language doesn’t include syntax rules? Given that most languages don’t have syntax rules or anything like it, I’m gonna go out on a limb and say that most language introductions/overviews/tutorials don’t mention it.

Most? I question that. In fact, what languages can you say do not have syntax rules?

C, python, java, Fortran, ruby, Common Lisp, Haskell, go, zig (I think), forth, swift, cobol, pretty much any language that doesn’t directly descent from Scheme.

Re: A Friendly Introduction to Racket

#63
post #35
post #11

Much as I am a fan of Racket, this is not a friendly intro. It is a speedrun. When an introduction says “friendly”, I don’t expect it to assume that I know what lambda is. When an introduction says “friendly”, I don’t expect syntax rules to appear in it. At all.

not to mention a skull? is it a racket thing (or lisp in general thing) to spoof the grateful dead logo?

It used to be the official logo. The project was called PLT Scheme at the time.

Re: A Friendly Introduction to Racket

#64
post #16

While the language is interesting, sadly, nobody is using it in the wild. Maybe due to cumbersome deployment options? The ability to produce native standalone executables would boost its usage I believe.

Given that a lot of people use it in the wild I’m not sure where you’re getting that from.

Re: A Friendly Introduction to Racket

#66

Earlier quoted context omitted.

What makes this a desirable feature? From the perspective where local reasoning is the most desirable property a language can have, how does homoiconicity support that? I honestly am curious. I've seen a few examples presented for it, but they always seem like bad software engineering to me. Where's an example that does something in a cleaner way than alternatives present in other languages while remaining compatible…

> From the perspective where local reasoning is the most desirable property a language can have That's a perspective. If you're looking for a low-level language, then Scheme isn't it. (Forget iconicity - Scheme is garbage-collected. And supports continuations!) If you don't program in machine code - which would maximize local reasoning - then you must know the language with the Correct balance of local reasoning and…

https://prescheme.org/

Pre-Scheme is a statically typed dialect of the Scheme programming language, combining the flexibility of Scheme with the efficiency and low-level machine access of C. The compiler uses type inference, partial evaluation, and other correctness-preserving transformations to compile a subset of Scheme into C with no additional runtime overhead. This makes Pre-Scheme a viable alternative to C for programming virtual machines, operating systems, and embedded systems where the runtime overhead of a complete Scheme implementation is not desirable.

https://ryansuchocki.github.io/microscheme/

Microscheme, or (ms) for short, is a functional programming language for the Arduino, and for Atmel 8-bit AVR microcontrollers in general. Microscheme is a subset of Scheme, in the sense that every valid (ms) program is also a valid Scheme program (with the exception of Arduino hardware-specific primitives). The (ms) compiler performs function inlining, and features an aggressive tree-shaker, eliminating unused top-level definitions. Microscheme has a robust FFI (Foreign Function Interface) meaning that C code may be invoked directly from (ms) programs. Therefore, the power of the existing wealth of Arduino libraries is available within Microscheme.

Re: A Friendly Introduction to Racket

#67
post #35

Earlier quoted context omitted.

not to mention a skull? is it a racket thing (or lisp in general thing) to spoof the grateful dead logo?

It used to be the official logo. The project was called PLT Scheme at the time.

The evolution of the logo:

https://users.cs.northwestern.edu/~robby/logos/

The skull didn't last long.

Re: A Friendly Introduction to Racket

#68
post #58
post #55

Earlier quoted context omitted.

Does i + 1 look the same as "i + 1"? The first is an expression, the second is a string. In LISP, it's similarly (+ i 1) vs '(+ i 1). These sorts of shallow complaints can be made of any feature than one is not familiar with, hasn't used, and doesn't know or understand the benefits of. In any case, no one is forcing people to use this language or take advantage of this feature. P.S. The "response" actually ignores al…

To answer your question, yes it does look pretty much the same in the Lisp version, less so in the string version. Also I didn’t complain; I expressed the opinion that I don’t agree that homoiconicity increases the appeal of a programming language, because the drawbacks outweigh the possible benefits for me. I spent some time programming in Lisp and am familiar with how homoiconicity works there. The point is that th…

You will like:

https://parentheticallyspeaking.org/articles/bicameral-not-h...

Re: A Friendly Introduction to Racket

#69

Earlier quoted context omitted.

> From the perspective where local reasoning is the most desirable property a language can have That's a perspective. If you're looking for a low-level language, then Scheme isn't it. (Forget iconicity - Scheme is garbage-collected. And supports continuations!) If you don't program in machine code - which would maximize local reasoning - then you must know the language with the Correct balance of local reasoning and…

https://prescheme.org/ Pre-Scheme is a statically typed dialect of the Scheme programming language, combining the flexibility of Scheme with the efficiency and low-level machine access of C. The compiler uses type inference, partial evaluation, and other correctness-preserving transformations to compile a subset of Scheme into C with no additional runtime overhead. This makes Pre-Scheme a viable alternative to C for…

Also, CRUNCH from Chicken Scheme:

https://wiki.call-cc.org/eggref/6/crunch

Re: A Friendly Introduction to Racket

#70

Earlier quoted context omitted.

> From the perspective where local reasoning is the most desirable property a language can have That's a perspective. If you're looking for a low-level language, then Scheme isn't it. (Forget iconicity - Scheme is garbage-collected. And supports continuations!) If you don't program in machine code - which would maximize local reasoning - then you must know the language with the Correct balance of local reasoning and…

That's not at all what local reasoning means. Local reasoning is the property that a piece of code contains (when including the call graph) everything that can affect what it does. All mutation of a value is kept within some scope of ownership of that value. If you want to understand a piece of code, you can do it by understanding that piece of code , not the program as a whole. Assembly makes non-local reasoning man…

Homoiconicity is orthogonal to local reasoning. It just means the syntax is represented by the native data format, nested lists. This does make code generation very straightforward with list processing primitives.

Mutation in scheme is possible, via set!, and set-car! and set-cdr!, but it's not recommended. Functional program design side-steps the issue.

see also:

SICP: 3.1.3 The Costs of Introducing Assignment

https://sarabander.github.io/sicp/html/3_002e1.xhtml#g_t3_00...

Post reply on HN