News for hackers. Stuff that matters.
Re:Racket Language by mark_l_watson on Saturday April 20, 2024 @11:57PM (#40103086)
I am happy to see Racket make it to the front page. After using mostly Common Lisp for research programming since 1982, I now more often turn to Racket. There are parts of Racket I don’t like, which is most everything *NOT* the compiler, package management system, GUI IDE, Emacs bindings, fun language to use.

I don’t care for much of the programming language research parts of the ecosystem - that is the parts that the computer scientist professors who run the project probably care about the most. More power to them!

So I feel like a freeloader on the Racket project, just enjoying the little parts I like and ignoring the rest, and not contributing anything (except maybe the little Racket book I wrote).

Re:Racket Language by MarceColl on Sunday April 21, 2024 @12:36AM (#40103205)
how do you deal with the very bad Racket repl? Thats what turned me off the language

edit: I dont reslly understand the downvotes, not trying to be rude or anything. Coming from CL the racket repl is very very barebones, it loses all state everytime you recompile. So I ask him how he deals with that coming from the very nice CL repl

Re:Racket Language by neilv on Sunday April 21, 2024 @01:14AM (#40103328)
The REPL in DrRacket is like that because it was made by professors, specifically targeting intro students who had never programmed before. They thought a big Run button with a clean slate each time would be less confusing.

You don't have to use DrRacket to use Racket.

People doing real work with Racket tend to have "workflow" setups that are closer to SLIME.

I personally used a simpler Emacs setup ("https://www.neilvandyke.org/quack/"), and ended up leaning more on modules and embedded unit tests ("https://www.neilvandyke.org/racket/overeasy/"), and less on very dynamic interactive evaluation like I'd done before.

Though, if you want to monkeypatch heavily, CL is famously good at that.

Re:Racket Language by djtango on Sunday April 21, 2024 @01:45AM (#40103430)
For someone lazy - what is the set up for the "evil" amongst aka vim users
Re:Racket Language by xhevahir on Sunday April 21, 2024 @04:18AM (#40104013)
There was a nice extension called DivaScheme that used unchorded keystrokes like vi and allowed structural editing but it stopped working when PLT Scheme reached version 5. (Which I think was when they changed the name to Racket.) https://cs.brown.edu/research/plt/software/divascheme/
Re:Racket Language by neilv on Sunday April 21, 2024 @02:18AM (#40103536)
Re:Racket Language by arbitrandomuser on Sunday April 21, 2024 @04:56AM (#40104164)
https://github.com/jpalardy/vim-slime

you can have a REPL in nvim/vim/tmux/screen/another terminal/or any other window , and send regions from your vim buffer to that repl

Re:Racket Language by tionis on Sunday April 21, 2024 @07:18AM (#40104760)
Conjure (https://github.com/Olical/conjure) for neovim should work quite well. I've been using it for quite some.time with Janet(another lisp)
Re:Racket Language by MarceColl on Sunday April 21, 2024 @01:25AM (#40103357)
Oh! okay, heavy misunderstanding by using DrRacket. Thanks for the clarification :)
Re:Racket Language by jnxx on Monday April 22, 2024 @02:47PM (#40117467)
I think Guile is a good example that one can have an SBCL-like workflow of live coding (with debugging and jumping right into a stack trace) in Scheme.

I have heard that this is not possible because Racket needs to make a stricgter separation of compile time and run time... but I am not sure whether this is actually true.

Re:Racket Language by neilv on Tuesday April 23, 2024 @02:24PM (#40135331)
Regarding the stricter separation, Racket and its module system have nicely clear concepts of phases. (I really like how the Racket module system has been used these to benefit the language.)

But, though I don't know current Racket internals, I'm not sure those need to be a barrier to monkeypatching that approaches CL.

Other than optimizations that make some debugging info and dynamic changes difficult-to-impossible, if the system had a mode to disable these optimizations (or to maintain some information in parallel that permits a cascading unraveling of optimizations affected by a change), I'm not aware of a fundamental reason the system couldn't support more loose poking at things.

Though, one implementation complication that Schemes do have is first-class continuations.

Re:Racket Language by samth on Wednesday April 24, 2024 @08:27AM (#40143551)
Very few people I know doing real work in Racket have a SLIME-like workflow. In general, Racket discouraging this style is related to us being a bunch of professors, but not really in the way you say. Instead, it's because it's not possible to give a sensible semantics to the top-level, especially in the presence of macros. We care a lot about macros, and we also care a lot about sensible semantics, and thus the attitude towards the REPL. The slogan in the Racket community that "the top level is hopeless" expresses this sentiment.
Re:Racket Language by lettergram on Sunday April 21, 2024 @12:40AM (#40103217)
Having used Racket in college for programing language ecosystem, I can say I don't enjoy that aspect either haha. Racket is easy to get started with and definitely great at what it does. If you're wading into Lisp IMO it's the way to go.

That said, IMO Clojure has a larger and more robust community, that said it's a bit of a bigger pain to set up (uses JVM) & has some more nuance.

Re:Racket Language by pjmlp on Sunday April 21, 2024 @05:25AM (#40104293)
Uses the JVM is exactly why Clojure is the Lisp like language I mostly bother with.

What matters are ecosystems and not languages on their own, so when switching between languages it is a great benefit that I can reuse my Java ecosystem knowledge, instead of adding yet another ecosystem to those I jump around between projects.

However, I really like the almost Lisp Machine like experience from using Raket.

Re:Racket Language by lispm on Sunday April 21, 2024 @04:37PM (#40109001)
IMHO, the Lisp Machine experience is completely different. Those have zero educational aspects, they were designed to write large, and stateful, applications, where the Lisp Machine OS is the big stateful object-oriented operating system (like Symbolics Genera). Interlisp-D is even more different.
Re:Racket Language by jnxx on Monday April 22, 2024 @02:49PM (#40117497)
One feeling I have is that while Clojure is incredibly tasteful, well-designed and elegant, it is less focused on Correctness as Racket. And this gives me the feeling that if I make some mistake (say, erroneously swapping arguments of a complex function that e.g. computes on list as sets), I do not know what is going to happen.
Re:Racket Language by eru on Tuesday April 23, 2024 @01:56AM (#40128941)
Clojure's biggest advantage, integration with the JVM ecosystem, is also its biggest drawback. JVM compatibility forces a lot of ugly compromises on Clojure.
Re:Racket Language by oumua_don17 on Sunday April 21, 2024 @12:55AM (#40103284)
I use CL on a day to day basis (and not in research/PL research domain), have never ventured into Racked yet. Can you please elaborate further on parts of Racket you don't like vis a vis CL? Thanks!
Re:Racket Language by shawn_w on Sunday April 21, 2024 @02:17AM (#40103529)
Not Mark, but I use Racket a lot and sometimes play with Common Lisp.

CLOS is way nicer than Racket's class/OO model and how generic functions are handled. Growable/resizable arrays are sometimes nice to have.

I prefer Racket and Scheme for the most part though.

Re:Racket Language by hiAndrewQuinn on Sunday April 21, 2024 @01:22AM (#40103349)
https://leanpub.com/racket-ai/read

I'd say this counts as a phenomenal contribution. :)

Re:Racket Language by darby_eight on Sunday April 21, 2024 @01:34AM (#40103387)
Ok, so to state the obvious, if you don't turn to racket for "programming language research" why do you use the language at all?
Re:Racket Language by tgbugs on Sunday April 21, 2024 @03:11AM (#40103758)
One reason is that it has one of the best cross platform native gui solutions out there. It exists because the research side was focused on teaching programming and needed a solution that their students could just install. There is a bit of a learning curve, but once you're over the hump it is just a pleasure to work with. See also things like https://docs.racket-lang.org/gui-easy/index.html.
Re:Racket Language by darby_eight on Sunday April 21, 2024 @03:21AM (#40103800)
Word!
Re:Racket Language by SkiFire13 on Sunday April 21, 2024 @09:03AM (#40105441)
> One reason is that it has one of the best cross platform native gui solutions out there.

I'm always a bit skeptical of these statements. How does it define "native"? Does it use gtk/libadwaita on Gnome and Qt on KDE? What about windows, does it use Win32, WPF, WinUI2 or WinUI3, all of which could be considered "native"? What about platform-dependent layouts?

Re:Racket Language by Bogdanp on Sunday April 21, 2024 @11:19AM (#40106422)
It's GTK on Linux, win32 on Windows, and Cocoa on macOS.
Re:Racket Language by lmz on Sunday April 21, 2024 @08:54PM (#40110599)
Is it still a wrapper over wxwidgets?
Re:Racket Language by Bogdanp on Sunday April 21, 2024 @11:56PM (#40111290)
No, it binds to the frameworks I mentioned above directly.
Re:Racket Language by kazinator on Sunday April 21, 2024 @09:00PM (#40110625)
How one defines "native GUI" is very simple: it uses the native widgets of the desktop OS, rather than custom-painting its own onto a pixel-level canvas. Buttons, input fields, lists/combos, context menus, the file picker dialog, what have you, are from the host system.
Re:Racket Language by bananapub on Monday April 22, 2024 @05:56PM (#40122025)
it's not that simple on windows, at least: https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-g...
Re:Racket Language by djtango on Sunday April 21, 2024 @01:43AM (#40103422)
As a Clojure developer who did write some Racket, there is a satisfying purity to Scheme (at least to me).
Re:Racket Language by darby_eight on Sunday April 21, 2024 @02:51AM (#40103674)
This is a wonderful answer!

I return to my main calling: figuring out why people use PLT scheme without an academic incentive. There must be an answer here somewhere....

Re:Racket Language by triyambakam on Sunday April 21, 2024 @02:55AM (#40103697)
Is this a joke or why don't you think they answered the question?
Re:Racket Language by darby_eight on Sunday April 21, 2024 @02:58AM (#40103708)
A) this is absolutely a joke

B) they haven't answered which cookie color makes them bananas for their ultraspeculated examination coming up this tuesday

C) It's meaningful the only product anyone has built from racket has been hacker news itself.

Re:Racket Language by runesoerensen on Sunday April 21, 2024 @03:05AM (#40103739)
This is just getting more confusing.
Re:Racket Language by darby_eight on Sunday April 21, 2024 @03:13AM (#40103772)
amen
Re:Racket Language by runesoerensen on Sunday April 21, 2024 @03:57AM (#40103944)
Re:Racket Language by jnxx on Monday April 22, 2024 @02:44PM (#40117438)
I guess one can think of Clojure as a very Scheme-affine Lisp. Which is not surprising since Scheme was a kind of distilled iteration of Common Lisp as a common denominator.

Are there any Schemes which are as "Batteries included" as Clojure with broad and deep library support? (I think Racket has quite good support!)

Re:Racket Language by rscho on Sunday April 21, 2024 @03:26AM (#40103821)
Ergonomics. It's extremely easy to use, especially in the GUI department. Generally, many things are super easy to use but not always top performance. Other things (macros) are truly exceptionally powerful, but rather complicated.

So, industry-grade customer-facing code? Not its focus, maybe not. But incredibly easy internal tools? Sure!

Re:Racket Language by fuzztester on Sunday April 21, 2024 @01:55PM (#40107724)
>It's extremely easy to use, especially in the GUI department.

You mean it's easy to build GUI desktop apps with Racket?

Re:Racket Language by rscho on Sunday April 21, 2024 @04:22PM (#40108891)
Yes
Re:Racket Language by bmitc on Sunday April 21, 2024 @10:47PM (#40111054)
It becomes very limited quite quickly though. One quickly has to move to the pasteboard editor functionality, where you basically have to recreate everything yourself in a canvas, as the normal buttons and other graphical elements are not supported inside a canvas since they are native OS widgets.

I started trying to build a complex enough GUI and just quit. There are bugs and the documentation is extremely terse. You have to rely on blog posts by one developer who has sorted it all out, but it's still really difficult to get an explicit handle on the concepts and functionality. Very, very few people use the pasteboard editor for complex things or even simple things. You'll be forging a path of your own for sure.

Re:Racket Language by rscho on Wednesday April 24, 2024 @02:41AM (#40141381)
The common sentiment is "if it's not used in DrRacket, you'll likely be on your own". That's more of a limitation due to the small community than a testament to the GUI framework quality itself, IMO.
Re:Racket Language by bmitc on Friday April 26, 2024 @09:42AM (#40169302)
I found several bugs in the framework and gave up.
Re:Racket Language by zem on Sunday April 21, 2024 @02:34AM (#40103612)
it's also a lovely general-purpose language, very pleasant to use.
Re:Racket Language by eru on Sunday April 21, 2024 @03:05AM (#40103738)
The same reason people use Haskell outside of 'programming language research', too, perhaps?
Re:Racket Language by t4ng0pwn3d on Sunday April 21, 2024 @06:04AM (#40104451)
A lisp with a lot of features built in (websites, guis, etc)
Re:Racket Language by MrBuddyCasino on Sunday April 21, 2024 @03:31AM (#40103845)
You might be happy (or sad) to hear you‘ve just qualified for the HN humble-brag finals.
Re:Racket Language by rpdillon on Sunday April 21, 2024 @10:50AM (#40106174)
There is something edgy about calling oneself a community freeloader and then casually mentioning you wrote a book on the topic.
Re:Racket Language by BaculumMeumEst on Sunday April 21, 2024 @06:41AM (#40104590)
I agree with every word of this.

The packet management system, the GUI IDE (which includes a step debugger), the ability to write a cross platform IDE (which is maintained by the core Racket team themselves), and the ability to easily produce runnable binaries make Racket my favorite Lisp hands down.

Those features are so incredibly useful and important, I really can't state it enough. I love Lisps, but at work, I will only use a language if it's the best tool for a job. Because of several of those features, Racket has been the only Lisp I've ever been able to justify using.

Because of the community, tooling and learning resources available, Racket is such an easy language for me personally to recommend to people. There are things I really like about CL and Clojure too, both of which I have used quite a bit, but I would never recommend them to people because of some huge drawbacks that come with each.

I also don't jive with the research parts of the language , nor do I care about the "lang" facilities, and I also kind of strongly dislike HtDP. But my perspective on all that is that they are projects I am uninterested in that happened to be made with a language I love, rather than knocks against the language itself, because I never bump up against them.

Re:Racket Language by temporarely on Sunday April 21, 2024 @04:26PM (#40108921)
"Wall, chilern, whar dar is so much racket dar must be somethin' out o' kilter."

(Thank you for the book - will be reading)

Re:Racket Language by spdegabrielle on Wednesday April 24, 2024 @07:58AM (#40143310)
What are the 'programming language research parts of the ecosystem'?

The only part of the Racket distribution I can see that is specifically 'programming language research' is Redex.

In the language itself there are the metaprogramming capabilities - but all modern languages have metaprogramming.

My experience of the community is it is generally people talking about real problems.

People do use Racket for PL and other research, so a number of PL research papers and conference talks do reference Racket, but it doesn't dominate any of the discussion.

e.g. https://racket.discourse.group/t/levin-tree-search-with-cont...