News for hackers. Stuff that matters.

soegaard

Re:Templates for Woven Christmas Hearts on Tuesday October 20, 2026 @07:24AM (#50164612)
This is not my project, but I just had to share.

It is a tradition here to make woven paper christmas hearts. It's a fun activity for children and adults alike. This web site show both classical hearts - but also allows you to design your own.

Re:Python's pre-declared constants are kinda weird on Wednesday August 26, 2026 @05:50PM (#49456394)
There is a reason for that.

Consider appending two strings in Scheme:

    (string-append s1 s2)
Appending two strings in Scheme:

    (vector-append v1 v2)
Since the type is present in the function name, it would be redundant to include it in the variable name.
Re:A Friendly Introduction to Racket on Sunday August 23, 2026 @11:14AM (#49409483)
You need to use the Racket documentation.
Re:A Friendly Introduction to Racket on Sunday August 23, 2026 @09:51AM (#49408864)

    > `(1 ,@2)
    '(1 . 2)
This is a pair. The notations is called "dotted pair".
Re:A Friendly Introduction to Racket on Saturday August 22, 2026 @08:01PM (#49405026)
I am not 100% sure what's going on, but you can use `read` mode this way:

    #lang racket
    (let ((a (read (open-input-string "#0=(0 . #0#)"))))
      (display (car a)))
I think the problem is that `read` / `write` support shared data constructed using `shared`. But programs (read by `read-syntax` are not allow to have cycles.
Re:A Friendly Introduction to Racket on Saturday August 22, 2026 @07:21PM (#49404819)
That has been in Racket for a long time.
Re:A Friendly Introduction to Racket on Saturday August 22, 2026 @05:58PM (#49404268)
The evolution of the logo:

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

The skull didn't last long.

Re:A Friendly Introduction to Racket on Saturday August 22, 2026 @05:30PM (#49404057)
> 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 on Saturday August 22, 2026 @05:17PM (#49403973)
Btw - if people are interested in Racket related blogs / articles etc.

https://racket-stories.com/

Re:A Friendly Introduction to Racket on Saturday August 22, 2026 @04:27PM (#49403539)
Yeah - the number syntax is pretty cool.

    #i is the prefix for inexact
    #e is the prefix for exact
So `#e0.1` is exact 0.1 which means it will be read as an exact fraction 1/10 and `#i0.1` will be read as a floating point number.

The `i` in `8i` is the imaginary unit. The `1@1` is the polar notation for complex numbers.

The `10#` is a compatibility remain (the Scheme authors wanted a way to see how many signifant digits were known. In `10#` there 2. So `#` stands for "some digit". In most implementations this is read as 0. More details at [1]

An `#` followed by a list datum is read as a vector. Thus `#()` is an empty vector and `()` is an empty list.

[1] https://stackoverflow.com/a/10936403/23567

Complicated? Well, to support both inexact (floating point) and exact numbers (bignums and fractions) it makes sense to have `#i` and `#e` to explicitl choose. The default is (more or less): numbers with . are inexact the others are exact.

Re:Rhombus 1.1 is now available on Monday August 17, 2026 @08:49PM (#49339742)
> DrRacket seems to have doing the thing where they implement of a bunch of GUI stuff from scratch ...

The GUIs actually use the underlying native GUIs thanks to the dynamic FFI. The goal is to have a cross platform GUI. Your program runs on macOS, Linux and Windows without any problems.

But if there is some gui feature, that is only available on one platform, you won't find it in the builtin gui libraries. However, you can always add platform specific functionality yourself.

Re:Rhombus 1.1 is now available on Monday August 17, 2026 @07:05PM (#49338908)
The email is obfuscated.

https://pkgs.racket-lang.org/

And has been for a long while.

Re:Rhombus 1.1 is now available on Monday August 17, 2026 @02:24PM (#49335452)
As most other things - you get used to it.

But it's important to note, at you need editor support for rendindenting blocks easily and correctly.

Re:Racket v9.3 on Saturday August 15, 2026 @03:34PM (#49313552)
Notice that Racket now supports "tree lists".

https://docs.racket-lang.org/reference/treelist.html

Re:Racket v9.3 on Saturday August 15, 2026 @11:41AM (#49311515)
Fear not, you can make `#%top` and `#:app` rewrite `foo:` to `#:foo`.

FWIW choosing `#:foo` over, say, `foo:` was due to backwards compatibility. In Scheme and Racket `foo:` is a legal identifier, so there might have been programs that stopped working, if `foo:` suddenly was a keyword.

Re:Steel Bank Common Lisp version 2.6.7 on Monday August 03, 2026 @01:04PM (#49158502)
It was running an old version of BC.

I can't remember the details, but I recall that Arc was pinned to an older version of Racket and didn't benefit from improvements to BC and then later to CS.

But ... be aware that the Arc interpreter is much more dynamic than Racket, so in general normal Racket programs are more efficient than Arc programs.

Re:Rhombus v1.0 on Wednesday June 24, 2026 @07:39PM (#48666867)
In DrRacket mark the section (with shift+arrows) then use tab or shift+tab.
Re:Rhombus version 1.0 is now available on Wednesday June 24, 2026 @08:16AM (#48658576)
Looks like a real conference - but the first thing you see is a large image of Rick Astley ?!
Re:My thoughts after using Clojure for about a month on Saturday June 06, 2026 @09:31AM (#48424937)
> I LOATHE the fact that you traverse lists and vectors in completely different ways

In Racket:

    (for ([x xs]) (displayln x))
This works for `xs` being a sequence, which includes lists and vectors.

Making the type explicit generates faster code:

    (for ([x (in-list   xs)]) (displayln x))
    (for ([x (in-vector xs)]) (displayln x))
The version Microsoft used is discontinued. However, you can just buy a license of the new product.

https://www.wiris.com/en/mathtype/

Re:Why I Still Reach for Lisp (& Scheme) Instead of Haskell on Thursday April 30, 2026 @08:53AM (#47961672)
Agree. It got the ball rolling.
Re:WASM is not quite a stack machine on Tuesday April 28, 2026 @12:11PM (#47936419)
Don't you need parens here?

    (local.get 0)
    (local.get 1)
Re:WASM is not quite a stack machine on Tuesday April 28, 2026 @06:33AM (#47932590)
FWIW if you are looking for examples of WebAssembly written in the textual format, take a look at:

https://raw.githubusercontent.com/soegaard/webracket/refs/he...

As a small example, here is a definition of `$car` which extracts the first value from a pair.

    (func $car (type $Prim1) 
               (param $v (ref eq)) 
               (result (ref eq))
      (if (result (ref eq)) 
          (ref.test (ref $Pair) (local.get $v))
          (then (struct.get $Pair $a (ref.cast (ref $Pair) (local.get $v))))
          (else (call $raise-pair-expected (local.get $v))
                (unreachable))))

Show HN: Command line tool for viewing files in color

https://soegaard.github.io/peek/

The tool `peek` show files in color in the terminal. A wide range of popular programming language and file types are supported.Today I added support for binary files inspired by the HN post on colors in hex editors.Each supported programming language is backed by its own (reusable) lexer. The lexer provides a stream of tokens to the colorer. Using streams means that you will see the top of...

( Read More... | no comments | on HN )
Re:Your hex editor should color-code bytes on Thursday April 23, 2026 @09:52AM (#47875773)
This was a great article and inspired me to add support for binary files in `peek`.

https://soegaard.github.io/peek/#%28part._binary-files%29

For me the key insight is that similar values should get similar colors. And since Fx and 0x are "similar" the color palette should be cyclic.

Re:Nanopass Framework: Clean Compiler Creation Language on Sunday April 19, 2026 @06:35PM (#47828261)
Yes.

Older ยป