Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 38 days ago | link | parent | on: Pg just released a new Lisp: Bel

That one was Believe, written in C11. Here's the link again: https://github.com/luksamuk/believe

Looks like there's another project now, BelJS, written in JavaScript: https://github.com/ajlopez/beljs

3 points by rocketnia 59 days ago | link | parent | on: Pg just released a new Lisp: Bel

From the perspective of my time on Arc Forum, it's great to see Bel. For most purposes Bel is pretty similar to Arc, but the Bel guide goes into pretty extensive detail about how Bel is intended to work, and that's information that was pretty sparse for Arc implementers and maintainers.

The fact that Bel contains a full description of reading, printing, and even arithmetic and thread arbitrarion means when someone tries to implement Bel in a non-Racket language, they'll have a good idea of how much work they're getting themselves into. They won't get lost in Racket documentation trying to understand how Bel works, and they won't find themselves questioning whether they need to implement every single obscure Racket feature just because a Bel program might use it.

I think some of the specific design choices in Bel are a bit wacky, like using mutable lists to represent numbers, functions, and continuations. Frankly I hope people won't invest their time trying to implement it all with perfect precision. Still, the goalposts are far clearer than trying to implement Arc.

---

I'm seeing a few pairs of design choices in Bel that seem to be in opposition, which might be a sign that one of the two is a bug. I suppose I don't know how many of these will turn out to be actual bugs, how many will turn out to be by design, and how many will turn out to be spurious products of my own misunderstanding.

1. Why do missing arguments to prims like `join` and `car` default to nil? In contrast, why do almost none of the functions defined in bel.bel have arguments that default to nil? It seems like the explanation for one of these would apply just as easily to the other, so I'm curious where the difference comes from.

2. Dynamic binding in Bel is a little surprising: "Dynamic bindings take precendence over lexical bindings, which take precedence over global ones." Does that mean we can set up dynamic bindings that interfere with the local lexical bindings of a function we call, like this?

  > inc.10
  11
  > (dyn n 4 inc.10)
  5
If Bel's functions expose their local bindings this way, then why do its macros go to the trouble to use gensyms (uvars) to avoid exposing theirs?

3. Exploring another consequence of dynamic binding: Considering the way Bel's macro calls are expanded at run time, can we can interfere with the local variables of macros' macroexpansion logic as well, like this?

  > (repeat 5 prn!hello)
  hello
  hello
  hello
  hello
  hello
  nil
  > (dyn init 'prn!4 (repeat 5 prn!hello))
  4
  4
  hello
  hello
  nil
If indeed we can do this, then why can't we do the same thing with Bel's special forms? Special forms' implementations are invoked at run time as well, but they're invoked using a plain function call in the interpreter rather than using `applyf`, so it looks like they have access to the dynamic scope of the interpreter host rather than that of the interpreted guest.

4. In the the printer, special care is taken for strings: "strings are lists and can thus share structure with other things we're printing." Shouldn't the printer pay the same kind of attention to numbers, since those are also lists?

4 points by rocketnia 59 days ago | link | parent | on: Pg just released a new Lisp: Bel

There's at least one implementation attempt starting up here: https://github.com/luksamuk/believe

Other name ideas:

- (isa bel)

- Rebel -- similar in theme to "Anarki," although there's already an unrelated Racket library called "Rebellion"

- Bombelli -- analogous to the spelling of "Anarki," and it can refer to a mathematician credited for putting complex numbers on solid ground

- Pachelbel -- would be a good name for an implementation written in D :-p

3 points by krapp 62 days ago | link | parent | on: Pg just released a new Lisp: Bel

I assume someone is already working on a Racket implementation.... wish I knew how, it looks like it would be fun.

Might I suggest calling it "Babel?"

2 points by breck 62 days ago | link | parent | on: Pg just released a new Lisp: Bel

Woohoo! 3 text files. So simple. Looking forward to playing with it.

It's also just very cool that he is still doing great science.

3 points by zck 63 days ago | link | parent | on: Pg just released a new Lisp: Bel

And he posted a "Show HN": https://news.ycombinator.com/item?id=21231208

I was a bit shocked when I saw this and wondered how they’d handled tail call optimization since there’s no nice way to do a computed jump in web assembly. It turns out it relies on the new tailcall extension to web assembly that isn’t enabled yet in most browsers.

Still this is pretty cool! A lot of languages have web assembly compilers but few seem to make self hosting a priority.

2 points by jsgrahamus 93 days ago | link | parent | on: Fleetdb

Project seems to have been inactive for 5 years.

Best link I found is https://github.com/mmcgrana/fleetdb

2 points by breck 105 days ago | link | parent | on: Visible Lisp Computer

Very neat. It would be cool if there were a live emulator you can see on the web to play with it in action virtually.
1 point by akkartik 106 days ago | link | parent | on: HTTP Request in ARC

Indeed. Here's an example:

    arc> (load "lib/client.arc")
    '()

    arc> (mkreq "http://example.com")
    '(("HTTP/1.0 200 OK"
       "Cache-Control: max-age=604800"
    ...
2 points by tug 106 days ago | link | parent | on: HTTP Request in ARC

this seems to be part of it

https://github.com/arclanguage/anarki/blob/b700e02f1442b6f56...


Great! Yeah, I'd love to hear how you fare following the examples in the Readme.

The examples involving gen_iso take a while to run, which may be even greater atop VirtualBox. I'd recommend skipping those for now, particularly the very first one at the top of the Readme.


Thanks for this. I maintain Linux Virtual Boxes.

I built an Arc-inspired toy Lisp interpreter like, oh, 5 years ago: http://akkartik.name/post/wart. (Source code: https://github.com/akkartik/wart)

But the experience frustrated me. It was hard for me to understand all the software under me as I provided abstractions above me.

So I spent the last 5 years gradually eliminating all the layers of abstraction that add complexity to my Lisp interpreter. The path passed through one other language for teaching programming: http://akkartik.name/post/mu. The sources for it are archived at https://github.com/akkartik/mu1 (there was an earlier prototype in Arc at https://github.com/akkartik/mu0)

At this point I have a very simple syntax for programming pretty much directly in machine code: https://github.com/akkartik/mu#readme. It can be translated to an ELF binary for Linux using about 250KB of static x86 instructions (80% of which are unit tests, and much else of which is duplicated because I built the translator in multiple passes that run in a shell pipeline:

    $ cat examples/ex1.subx |./tests |./dquotes |./assort |./pack |./survey |./hex > a.elf
    $
)

The nice thing about the resulting ELF binaries is that they can be run directly on a Linux kernel with no other dependencies. Not even libc.

There's a script in the repo called `gen_iso` that can take a list of .subx files, translate them into an ELF binary and package up the ELF binary with just a Linux kernel into a bootable disk image. You can then boot this image either in Qemu or on a cloud service like Linode (http://akkartik.name/post/iso-on-linode)

This is what I have so far.

By contrast, the screenshot is quite fake. It's just a program that reads a line of text from the keyboard and prints it out to the screen. You can see it running on an emulated computer in Qemu that has nothing but a Linux kernel.

But I'm going to build up from that core into a high-level language. Maybe an Arc-inspired Lisp. Not a toy this time around.

Just give me 5 more years :D

To reiterate the main project link: https://github.com/akkartik/mu#readme. Should hopefully be pretty easy to get running on Mac or Linux. (Though you're mostly on Windows, right jsgrahamus? I'm really sorry I still don't know Windows well enough to support it :( )


What is this exactly?
3 points by akkartik 125 days ago | link | parent | on: Mu no longer requires C

As of last night, Mu can package up a codebase (Assembly files in my special syntax) with a Linux kernel into a bootable disk image and deploy it to Linode. I've updated the top of https://github.com/akkartik/mu#readme with details.
1 point by akkartik 132 days ago | link | parent | on: MakerLisp Embedded Lisp Machine

My MakerLisp machine is up and running!

https://mastodon.social/@akkartik/102555471982690487


>The big drawback: you have to give up '-' in symbol names.

I wouldn't have a problem with that, but I'm probably of a minority opinion, since that seems to be a Lisp thing. When I started with Arc it took me a while to realize that symbols with asterisks in the name weren't something special like pointers, and using angle brackets just seems wrong after years of writing HTML.

Although if it were possible to do something along these lines, one could have the best of both worlds:

    (defgrammar infix ...)
 
    (w/grammar 'infix (do


    ))

https://groups.google.com/forum/#!msg/racket-users/HiC7z3A5O...

Have you seen my proposal for infix syntax for Arc? I think it's pretty nice: http://arclanguage.org/item?id=16775. The big drawback: you have to give up '-' in symbol names.

We already have syntax in the form of bracketed functions (or whatever they're supposed to be called) and {} for tables.

I'm speaking out of my depth here, but I think it would be nice if scoped syntax extension were a "first class" feature of Arc. It would be nice to be able to load, say, native support for XML syntax as a library or something, or to easily extend the language through grammar definitions.

Also, infix notation in a Lisp? If I had a monocle I would drop it into my coffee with shock forthwith!


In the "State of Racket" presentation, Matthew Flatt talked about how it was a ripe time to start seriously pursuing "Racket 2" and thinking about radical changes that could be made to the language. Then he surprised many people by showing a slide with some infix syntax ideas.

We've had many discussions about s-expressions with syntax here at Arc Forum, and it looks like the Racket community is going to dive into that topic now. It could be the best time ever for us to get involved with the platform we've relied on.

3 points by akkartik 157 days ago | link | parent | on: Readable Lisp S-expressions Project

My critique: https://news.ycombinator.com/item?id=8503353#8507385

The final straw for me was when I tried to actually _use_ sweet expressions for something. I described it here: http://arclanguage.org/item?id=16699 (Warning: lots of bad ideas in this thread)

2 points by jsgrahamus 169 days ago | link | parent | on: Arc and Scheme in Emacs Lisp

Very nice. Thanks, Shawn!
1 point by akkartik 173 days ago | link | parent | on: MakerLisp Embedded Lisp Machine

I'm considering buying this machine in a month or so. (The author says the full system will be available in a month: https://www.tindie.com/products/lutherjohnson/makerlisp-ez80... .)

Hair loss would be due to trying to think in a Klongish manner. Have only gotten a ways into the Klong book.

Nils is a prolific author and has even written non-CS titles to include Yoga and Zen (in German).


Very cool! The codebase (http://t3x.org/klong/index.html#download) or the book (http://t3x.org/klong/book.html)?

I’ve spent uncounted hours enjoying and pulling out my few remaining hairs with Holm’s Klong. Look forward to reading this.

Thanks for the heads up, akkartik!

2 points by i4cu 214 days ago | link | parent | on: Beunto an experimental app builder

Hmm, haven't seen that one. I've done a search on my entire code base tree and 'randid' is nowhere in my code (of course that may not matter when it's a compiled jar file that's running).

Can you tell me your OS? I've only been using OSX so it's possible it's chrome on Windows? Versions would be great too, if you can :)

And is that a js error or a server error? I'm hazarding a guess it's a js error given I'm not seeing any errors on the server.

Thanks!

2 points by mpr 214 days ago | link | parent | on: Beunto an experimental app builder

Hey -- I tried to go to the link but nothing loaded. This shows up in the Chrome console:

"Uncaught Error: No matching clause: :randid"

More