I would note however, that being developed by academic greats and being based on that language is exactly what enables it to stand out. It is usually academics, who innovate in PLT and come up with new elegant concepts, that one can use to tackle lots of challenges.
I've wanted to develop desktop UIs that look professional and are lightweight, and I wonder if Racket, with its built-in UI framework, could be a good choice.
I did try it once but the hello world app was already really heavy (200MB of RAM instantly taken , if I remember correctly), but maybe I did something wrong (debug mode perhaps??)
Can I package a Racket app with a MacOS installer and sign it? How about Windows and Linux?
If you want to see some "real world" high quality Racket GUI stuff this is the place to go. Very inspiring. I'd love to do more with Racket & its GUI lib.
(require racket/draw pict racket/gui/base racket/class)
;; avoiding pulling in to many extra deps so have to redefine some useful functions
(define (first lst)
(define (second lst)
(define (third lst)
(define (false? val)
Thankfully after creating a basic frame and canvas, the jumps haven't been as big, but I could easily see the program going to 400M by the time it's done. I will download Racket 8.0 today and see how it performs
I think once Gerbil scheme becomes more mature I'll do more work in that. It's faster, smaller, and borrows a lot of things from Racket that I like.
I installed racket 8.0 (super easy and removed the old installation as well!) and compiled my program. Compiling it and running it results in it going from 280M down to 220M, That's a 27% improvement. Creating an exe brings the memory usage back to 243M but that's still down. I'm less familiar with creating exes so there might be some settings I can tweak.
As for debug mode, you should AOT compile with 'raco make' to run a fair test.
In German there is a word called "Schadenfreude" whose literal translation into English is Schaden "damage" freude "joy". The actual meaning is roughly ...
The experience of pleasure or joy, that comes from witnessing failures, or humiliation of another.
Q: Can you explain the value proposition of DSLs?
Given more expressive power, with appropriate training, it could be incredibly empowering, allowing for more expressive and maintainable systems.
It could also create an absolute mess, and some might argue that more power means more ways to shoot yourself in the foot, hence I think that kind of methodology requires the training up front and overall good software discipline.
I am a junior-mid developer so I know squat really.
A: Cognitive Impedance Matching
To be fair, in English we would just say schadenfreude today.
edit: I'm apparently blind and missed the same comment already made yesterday: https://news.ycombinator.com/item?id=26134050
Guess I'm a day late and a buck short.
This proposition is often criticized by software engineers for resulting in code that is potentially inscrutable to anyone but the writer. IMO, this misses the forest for the tree. Sure, one-off DSLs probably aren't suited to entreprise codebases you'd use Java for. But what the critics miss is that this truly enables domain experts. In that way, it's a bit like the MS Excel value proposition cast into a (very well-designed) programming language. Which makes it ideal for solo devs, scientists, small teams, etc. (as most lisps). That's what makes Racket interesting to me, at least.
For building DSLs the following features are useful:
Scope controling what is allowed.
Also you can really, really change both syntax and semantics:
Although not similar technically speaking, Graal/Truffle is a better comparison in spirit, IMO. But Graal/Truffle is hugely complex, with many many man-hours in it.
Classic example and discussion:
Also you can really, really change both syntax and semantics: https://docs.racket-lang.org/2d/
Exactly, racket give you much more freedom because of this, I don't know the use cases but it's indeed more powerful.
A comparison with Truffle would be great! I wonder if a higher level/simpler but less powerful abstraction on top of Truffle could bridge the difficulty gap.
There's a new method to doing that, pioneered by these
Racket folks, called "Language Oriented Programming".
And what it means is that the first step to solve your
problem is to create the simplest language you can think of
to describe your problem.
So let's create a language where you can list everyone's
toys like this "ballToy", "elsaToy", "blockToy". And then we
can list all your friends like this "Adam", "Emily", "Maya".
And then we can list feelings like "Happy", "Sad"...(going
to skip the meat for brevity)...and then we rearrange these
words until we get the program with the most Happys! And
we've solved the problem using "Language Oriented
Programming". We spent our time not on the computer
language, but on creating a new simple domain specific
language customized for our problem.
I have many use-cases in mind for a DSL ( research projects and hobby). So would you know of some full-fledged (open-source) use cases where racket has been used to create DSLs ?
Besides of course all the Racket pages/systems (home page, package system, continuous integration system etc).
E-commerce is also possible.
"matchacha.ro, a small e-commerce site selling Japanese green tea"
If you are into quilting, then https://www.youpatch.com/
Performances are bad, but when playing with relatively small datasets, the portable (Linux/macOS/Windows) GUI, the huge stdlib, the ease of deployment of fat binaries and the pleasantness of the language in itself make for a very seductive tool.
I could use any language with reasonable parsing tools, but I like how flexible Racket is about it. Currently using megaparsack, but there are many different parsing tools available depending on your needs. Also, once you have done parsing, there are lots of convenient ways to manipulate the parse trees into whatever shape you need.
I also think Racket has a lot of tooling that would make it great for large code bases.
-It has great offline docs (scribble) which don't force you to use some comment based system like JavaDoc.
-It has a very powerful and fast contract system that can be attached either at definition time like most languages or only at module boundaries.
- While it has a macro system, it has a really good macro debugger (it lets you view how the code is iteratively expanded with options to show/hide the expansion of various macros). Since even non-hygienic macros deal with syntax objects and not just datums, macros don't even screw up error messages since line/column info is preserved!
- You compile to executables unlike most scripting languages.
- You can write some code with types and some with them, but unlike say TypeScript the boundary between typed and untyped code is sound since contracts are used to verify these boundaries.
- A lot of the time you don't even need types because most names (i.e. variables and functions) are verified at compile time (to be more specific, at macro expansion time).
- It has very aggressive sandboxing tools that let you control not only what names are visible to some untrusted code, but also control how much memory it uses without creating a new process.
- Safer global variables in the form of parameterize. Very convenient for stuff like when you need to temporarily change the stdout for a single call.