Arc Forumnew | comments | leaders | submitlogin

I meant to submit this post when I first saw it, but forgot :)

Quite a while ago I silently made the decision to keep my opinions on language design to myself most of the time unless I had a language to show for it. :) Cene has come further along than any language I've made before. Part of that is because I learned some skills at work, and part of that is because I didn't want to bring it here until it was in a very polished state.

Cene has currently stalled a bit as I try to generalize the macro system to support quasiquotation macros, reader macros, and better error messages. This post touches on that topic a bit, particularly the error message part. In the 16 days since this post, I've tried to work on an implementation of this new macro system. My initial attempts were full of errors, and as I keep trying to organize my thoughts, I've learned a lot about Racket macros and category theory, but I still haven't found a way to implement the macro system. In a couple of days I'm planning to write another post about where I've gotten with that and what the difficulties are.

3 points by waterhouse 2 days ago | link | parent | on: How many people still lurk here?

Hello there.

(This experiment also serves as a sample of how regularly the lurkers lurk.)

3 points by ymln 2 days ago | link | parent | on: How many people still lurk here?

Hi!
3 points by jsgrahamus 3 days ago | link | parent | on: Nice work, malisper!

http://arclanguage.org/item?id=20096
3 points by jsgrahamus 3 days ago | link | parent | on: Nice work, malisper!

Well, that is certainly true; although I was surprised at the recent post where all those other folks showed up.
2 points by akkartik 3 days ago | link | parent | on: Nice work, malisper!

I don't think we can :) This forum seems slow enough that I figured we had time to discuss something off-topic.
2 points by jsgrahamus 3 days ago | link | parent | on: Nice work, malisper!

Where does Arc get into a bind? No idea here.
3 points by jsgrahamus 3 days ago | link | parent | on: Nice work, malisper!

Makes sense. Thanks for the read.

How can we apply this to Arc, akkartik?

5 points by malisper 4 days ago | link | parent | on: How many people still lurk here?

I check if there is anything interesting here once every few days.
3 points by akkartik 5 days ago | link | parent | on: At-sign in string

Yes, the atstrings feature is turned off by default in Arc 3.1 (and also in Anarki's official/stable branches). I think I'll turn off the default in Anarki as well, and just let news.arc continue to make use of it.

Edit 1 hour later: This is now done. Turns out Anarki never meant to turn on atstrings by default. This was a side effect of loading news.arc by default (mea culpa). I've changed things so we load news.arc by default but only use atstrings in news.arc by default. Keep an eye out for subtle bugs introduced by atstrings being turned off when functions in news.arc are called. If we see any I'll probably take out the ability to turn it on and off and just decide to keep it everywhere or take it out entirely.

https://github.com/arclanguage/anarki/commit/d0eb0dcf17

5 points by jsgrahamus 5 days ago | link | parent | on: How many people still lurk here?

Me, too.
3 points by jsgrahamus 5 days ago | link | parent | on: At-sign in string

When I try this in Arc 3.1, I get no complaints.
4 points by akkartik 5 days ago | link | parent | on: How many people still lurk here?

Great idea, mikhail. Thanks for doing this. I now know of two readers that I wasn't at all aware of before! ^_^
4 points by nathanielrb 5 days ago | link | parent | on: How many people still lurk here?

hi!
4 points by zck 6 days ago | link | parent | on: How many people still lurk here?

I, too, am around.
5 points by prestonbriggs 6 days ago | link | parent | on: Operating Systems

I know of 2 examples of Lisp being used to develop an OS (there may be more): one by Symbolics (called Genera) and the other by Lisp Machine Inc (aka LMI). Apparently both of these descended from code developed at MIT's AI Lab. Googling, it sounds like some of the source code for one of the versions was released as open source.

Of course, Lisp Machine Lisp (or Zeta Lisp, et al.) are not the same as Arc, but I expect that what you can do in one, you can do in the other. Small matter of programming :-)

The interesting question is not the implementation language, but what you intend to build.

5 points by conanite 6 days ago | link | parent | on: How many people still lurk here?

hi!

Howdy
5 points by rocketnia 7 days ago | link | parent | on: How many people still lurk here?

Hi!
5 points by rocketnia 7 days ago | link | parent | on: Operating Systems

Arc is a pretty small codebase built on Racket, so I think if there's an answer to "Can Racket be used to write an OS?" then the Arc answer follows close behind.

I can imagine two distinct ways you might be interested in OS development, so I'll answer twice. :)

---

Personally, when I think about writing an OS, I'm motivated mainly by the prospect to design new ways that "applications" can be obtained, upgraded, and integrated with each other.

I would not want to develop low-level memory management code and device drivers. That would open up a can of worms in terms of security issues, not to mention the expense of keeping up to date on the latest hardware and the latest machine-code-based security topics. So my "OS" would ideally sit on top of another OS kernel.

For that kind of application, Racket could be great. Racket has tools for running computations in sandboxes with limited memory, so it should be practical to run a new kind of "application" this way as well. Looks like there's a way to run any X Window System client program as a kiosk (https://raspberrypi.stackexchange.com/questions/11866/how-ca...), which can probably be used to run a Racket GUI application. So it seems like all the tools exist to make a Racket program take the place of an OS desktop and manage its own applications.

Since Racket has these sandboxing and GUI features, technically Arc can invoke them too, since Arc can run Racket code. However, I don't think I've seen anyone use these features in Arc code yet, so it might be easiest to learn them in the context of writing a program in Racket itself.

---

On the other hand, if your goal is to do things that involve machine code, kernel privileges, and device drivers, you'll pretty much want a language where the run time semantics is very similar to machine code, with the ability to refer to specific memory addresses and the ability to initialize and manipulate its own call stacks. In many cases where you're using functionality specific to an architecture, such as booting up and initializing a first call stack, you'll need to write assembly code so that you know precisely what machine code is being generated.

There are many "C replacement" languages out there, but the one that I consider most approachable right now is Rust. It's easy to find a number of tutorials and examples of OS programming in Rust, and Rust is sort of a codification and streamlining of many techniques that have caught on in C, so the skills may be somewhat transferable between those languages.

---

In short: Racket (and hence Arc) has a lot of the high-level tools for making OS-like systems, but it's probably not good for the parts of an OS that require meticulous attention to machine code. I recommend something like Rust for those.

What OS skills or projects are you thinking of pursuing anyway? :)


Hello
4 points by blunder 8 days ago | link | parent | on: How many people still lurk here?

Me

1. Thank you! I figured arc could have gone a lot further with special-syntax, by making it configurable inside arc code.

2. this "open source" has had only two eyeballs on it so far ... attacks welcome :)

3. The execution stack is entirely plagiarised from rainbow so it should not be hard to re-implement continuations in the same manner ... the need hasn't arisen yet though ...

3 points by rocketnia 13 days ago | link | parent | on: 2D syntax in Racket

I don't know if I'd ever want to use this 2D syntax directly, but I'll probably "use" it as a thought experiment for non-hierarchical syntaxes, along with cellular automata and spreadsheets. :)

Can you imagine an 'unquote-splicing operation for this tabuleau syntax? Between lists, 'unquote-splicing can insert any list into any other, but the cells of these tables have externally imposed sizes and shapes, so for an 'unquote-splicing in a table (if we wanted one at all), we'd probably want to enforce that the sizes and shapes match up in a way that makes sense. What might make more sense is to do 'unquote-splicing in a full row or column at once, because at least we get one dimension of freedom that way. If the splice takes up a full row, then it can splice in any number of rows (of any height) to that location.

I'm probably a little obsessed with quasiquotation lately. I've been trying to write an implementation of a macro system where the meanings of notations like 'unquote, 'unquote-splicing, and parentheses themselves can be treated as user-defined macros, and where syntax-bound concepts like source locations and syntax highlighting are mostly managed automatically in the macroexpander rather than something every macro must deal with (except for the macros that do something unusual with them).


1. Oh, the clean implementation of classic Lambda Calculus syntax is awesome.

2. Your string interpolation implementation is just begging for an injection attack proof of concept :)

3. Why bother with continuations?!! Them's fighting words :)

3 points by akkartik 14 days ago | link | parent | on: 2D syntax in Racket

Oh, this is cute.

Welcome back, conanite! I was coincidentally just thinking about you yesterday when I ran across your bug report at http://arclanguage.org/item?id=10485. Too bad that bug is still open in both Arc 3.1 and Anarki. I think I will try to fix it now that I've spotted it.
1 point by akkartik 14 days ago | link | parent | on: At-sign in string

And it worked! Nicely done.
3 points by prestonbriggs 14 days ago | link | parent | on: At-sign in string

Got it, thanks.

I guess the quote idea came from me thinking that the strings were being evaluated. My untrained mind thought "strings evaluate to themselves", but apparently not. So I used the single quote to prevent evaluation.

More