
@notjack I was thinking of a converter to s-expressions (badly phrased sorry) as a pedagogical tool to learn how honu maps to the current syntax :)

The question I’m trying to answer is: How would Honu look like as a surface syntax for e.g. guile, or another scheme.

@conrad.steenberg that’s interesting! Kind of like a reader-level version of the macro stepper, maybe?

Yes, good analogy - or like being able to dump the output from the first pass of a multipass compiler.

@conrad.steenberg I’ve barely looked at Honu, but does honu-read
do what you want? #lang at-exp racket
(require honu/core/read)
(honu-read
(open-input-string
@string-append{
// A for loop that iterates between two bounds.
for x = 1 + 5 to 10 do
printf("x is ~a\n" x)
// Similar to above but shows a block of expressions in the body
for x = 1 to 10 do {
var y = x + 1;
printf("x ~a y ~a\n", x, y)
}
// A for loop that iterates over a list of numbers
for x in [1, 2, 3] do {
printf("x ~a\n", x);
}
}))
produces: '(for
x
=
1
+
5
to
10
do
printf
(#%parens "x is ~a\n" x)
for
x
=
1
to
10
do
(#%braces (%semicolon var y = x + 1) printf (#%parens "x ~a y ~a\n" honu-comma x honu-comma y))
for
x
in
(#%brackets 1 honu-comma 2 honu-comma 3)
do
(#%braces (%semicolon printf (#%parens "x ~a\n" honu-comma x))))

I think it still needs an enforestation step so it is closer to racket

Agreed :) Thanks for the answer though!