Arc Forumnew | comments | leaders | submit | akkartik's commentslogin
4 points by akkartik 5 days ago | link | parent | on: With and withs

I actually tend to the opposite: use with everywhere unless I need withs. The reason isn't performance. It tends to make code more elegant to not rely on the order in which things are defined. And when I'm reading code, with gives me the warm fuzzies that the code is going to be cleaner. When I see withs I slow down to look at the dependencies between the bindings.

reply

3 points by zck 5 days ago | link

Similarly to this, when I'm writing Java, I use `final`^1 everywhere I can. It's nice to be able to know that anywhere later where the variable declared final is in scope, it will have the same value as at the point it's set. I don't need to look through any code to see if it's rebound; I know it hasn't been.

[1] "final" is kind of like "const", if I understand `const` right. `final int x = 3;` means that it is an error to later have the line of code `x = 4;`.

reply

3 points by prestonbriggs 5 days ago | link

OK, I get it, thanks. In scheme, I would use letrec for this situation; my intuition for Arc isn't very well developed.

reply

3 points by akkartik 5 days ago | link | parent | on: With and withs

Try running without your code.

    arc> (help get)
    [fn]  (get i)
    Returns a function to pass 'i' to its input.
    Useful in higher-order functions, or to index into lists, strings, tables, etc.
    Examples:
      arc> (get.2 '(1 2 3 4))
      3
      arc> (get!b (obj a 10 b 20))
      20
      arc> (get.9 sqrt)
      3
      arc> (map get.2
                '((a b c)
                  (1 2 3)
                  (p q r)))
      (c 3 r)
    nil

    arc> (help set)
    [mac] (set . args)
    Sets each place in 'args' to t.
    nil
These are the functions you end up calling because your dispatch can't see the earlier get and set bindings.

reply

2 points by akkartik 7 days ago | link | parent | on: Self-hosting the Anarki community

I did ping the HN admins about the lock period a year or two ago, and they were kind enough to extend it for us. It's now 90 days, if I recall correctly.

reply


Looking forward to seeing what use you put user-defined unquote macros to!

reply

2 points by rocketnia 8 days ago | link

Thanks! :)

reply

2 points by akkartik 8 days ago | link | parent | on: Advanced search for news.arc

Huh, surprising to me that I'm listed as an owner of the arc organization on notabug.org! Did I click on something without realizing what I was doing? I don't see any email from notabug.org about the new organization in my email or trash..

Sorry, it seems I'm not wholly attentive lately.

reply

2 points by hjek 8 days ago | link

I clicked Invite but it must have just added you?

reply

1 point by akkartik 8 days ago | link

Do you happen to remember how long ago this was? If it was more than 30 days ago I may well have accepted and forgotten, and see no trace of it in my email's trash.

Adding people to organizations without informing them seems like a bad idea. It's also not what GitHub does, and GitHub is who all these sites are copying, so shouldn't be happening.

reply

2 points by akkartik 8 days ago | link | parent | on: Self-hosting the Anarki community

We still get newcomers with questions about Arc 3.1.

reply

2 points by i4cu 8 days ago | link

Sure, but from what I can see they soon quickly discover they need to use anarki and move over.

And impacting newbies does not appear to be considered in "focus on and develop our unique points of experimental language hacking". So...

edit: maybe I'm wrong, but it seems to me what he really wants is a language design group. And I'm fine with that, but I think it's wrong to conflate anarki users with language designers. They are not one in the same.

reply

3 points by shader 7 days ago | link

I was expecting arclanguage.org to stay mostly as it is. Support for newcomers to arc would be included in that.

You may not be entirely wrong, but I probably shouldn't have tried to compress a description of a language used and developed by a loosely federated group of unique individuals into a single phrase.

I can try to unpack it a bit...

"Experimental (language) hacking" -> Exploratory programming is supposedly a primary paradigm of arc

"Experimental language hacking" -> Arc isn't exactly production ready; it's a very experimental language, and that makes it fun (and sometimes frustrating) to use, and easier to explore new directions and possibilities. You're less likely to reverently assume that the way it is is the way it must be.

"Experimental language hacking" -> And yes, we hack on arc itself. So I am thinking a bit of a language design community, I guess. In an anarchic language community though, the lines between 'users' and 'designers' become rather vague...

reply

2 points by shader 7 days ago | link

Yep. We should definitely keep answering them too.

reply

3 points by akkartik 12 days ago | link | parent | on: Installation on windows?

Just greadlink in case the location where you cloned anarki lies somewhere within a symlink: https://github.com/arclanguage/anarki/blob/master/arc.sh

:/

reply

3 points by i4cu 12 days ago | link

ok thanks. I wasn't familiar with greadlink so I didn't know it was a 'thing'.

reply

3 points by akkartik 12 days ago | link

I kinda misspoke. The explanation is at the top of the file:

    Put a symlink to this script somewhere in your path.
The goal seems to be to deduce where the sources are, independent of where the driver script is called from.

reply

3 points by hjek 12 days ago | link

Why aren't we just using

    cd $(dirname "$0")
to change to the arc dir?

greadlink shouldn't be necessary.

reply

3 points by akkartik 11 days ago | link

That was my initial thinking as well, hence the ':/'.

But later I realized there's a good reason: http://arclanguage.org/item?id=20641

reply

2 points by hjek 11 days ago | link

Oh, symlinks! I see.

reply

2 points by akkartik 13 days ago | link | parent | on: Installation on windows?

The later version should work. The installation instructions here at http://www.arclanguage.org/install are unfortunately out of date. Please follow the instructions at https://arclanguage.github.io.

reply

2 points by hjek 13 days ago | link

It's kind of sad that while HN gets all these new features, no admin has taken 10 mins of their time to update the installation instructions here.

Akkartik, have you ever tried contacting PG/YC about allowing you to admin this forum?

reply

4 points by rocketnia 13 days ago | link

I've been pretty shy about it, but I finally sent a tweet three years ago.

https://twitter.com/rocketnia/status/658565199402692608

reply

3 points by akkartik 12 days ago | link

Tweets can be missed. Perhaps we should email hn@ycombinator.com.

I've been reluctant to do this, because the outcome may well be, "wait, is this old site really still up? Let's just take it down." :) Don't mind li'l ol' us out here, we're no trouble, no trouble at all..

reply

2 points by hjek 12 days ago | link

> "wait, is this old site really still up? Let's just take it down."

That is a valid concern. Perhaps, we could ask that if YC chooses to shut it down, could they at least give someone here a copy of the `www` folder?

Then someone could take over hosting this forum (which possibly might be on a different domain).

I have a somewhat reliable server running anyway, and it wouldn't be a problem for me to do this, but if someone else could do it, that would also be great.

But yes, worst case scenario is that this site is nuked. But that would just be such a disrespectful response, so I kinda doubt it..?

reply

3 points by i4cu 12 days ago | link

If someone does email, please request that the main page[1] be updated with a link to anarki as opposed to just a change in install instructions.

1. http://www.arclanguage.org/

edit: I'm ok if they take it down. I'll know where to go via the anarki wiki (if someone updates it). And it may actually be better if they do take it down IMHO as it will force everyone to find a place with more control over the setup.

reply

3 points by krapp 12 days ago | link

I mean... would it be so bad for the Anarki community to be hosted on a forum running Anarki?

reply

2 points by hjek 12 days ago | link

Then we would be even able to actually search stuff on the site!

reply

3 points by shader 11 days ago | link

I think if we fork the community site to run on anarki. which I think is more likely than being given control over the Arc Forum, we should consider ways to archive and bring forward all of the stuff on the existing arc forum. It shouldn't be too hard to crawl the forum, though I think there might be some DoS prevention that would slow it down.

reply


I'm not sure system programming is a good domain for Arc. Why not just Racket directly? The interpreter makes Arc quite slow.

reply

2 points by shader 14 days ago | link

Yeah, I probably wouldn't use it for that either, at least as much because of the relative instability and hackishness of arc. It was fun for a few minutes to imagine modifying it to be used that way though.

reply

2 points by rocketnia 13 days ago | link

Interpreter? Are you talking about Racket's bytecode interpreter?

reply

1 point by akkartik 12 days ago | link

No, I was forgetting that ac is considered a compiler :) But it compiles the Arc codebase every single time Arc starts up. Maybe we should start memoizing its outputs to disk somehow, see if that makes it noticeably faster. My suspicion is egregious runtime processing like ar-denil-last and ar-apply-args will cause it to not make a difference.

Given the pervasiveness with which Arc has to make such transforms at runtime, I've gotten into the habit of thinking of it effectively as an interpreter.

reply


I've been hanging out a good amount in the #bootstrappable IRC channel on Freenode lately. They seem to have a decent start at a fresh new stack that builds all the way up from machine code and can run a decent amount of C (as of last night: gcc, binutils, libc). There's also parallel infrastructure to build tiny proof-of-concept Lisp and Forth interpreters.

I think I may have my recent side projects retarget this stack. For the last couple of years I've been trying to create a better stack of system software for implementing Lisp (among other things): https://github.com/akkartik/mu#readme. I even started building something up from machine code, just like bootstrappable: https://github.com/akkartik/mu/tree/master/subx#readme. So I should hopefully be able to switch to bootstrappable fairly easily.

Their documentation is still poor. Here's what I've been able to piece together so far. The bottom-most repo is at http://git.savannah.nongnu.org/cgit/stage0.git. A writeup on it: https://bootstrapping.miraheze.org/wiki/Stage0.

From stage0, the basic flow is this:

* stage0/stage0/hex0 builds stage0/stage1/hex1.

* stage0/stage1/hex1 builds stage0/stage1/hex2.

* stage0/stage1/hex2 builds stage0/stage1/M0.

* stage0/stage1/M0 builds stage0/stage2/cc_x86.s

* stage0/stage2/cc_x86.s builds https://github.com/oriansj/M2-Planet, which is a bare-bones compiler for a subset of C that is also self-hosting.

* M2-Planet is on the way to building https://www.gnu.org/software/mes (there's still a gap here)

* mes can build gcc, binutils, glibc.

For Lisp, there's a tiny interpreter at http://git.savannah.nongnu.org/cgit/stage0.git/tree/stage2/l... that can be built with M0.

There's a decent amount of documentation, but I'm still finding my way around it. Not clear what order to read things, etc. The good news is that it builds. On any Linux system, 32-bit or 64-bit, you should be able to just run `make`. There's not a lot of code, and it seems worth spending time to understand. The folks on the IRC channel have been super helpful to answer questions.

This doesn't answer your immediate question. But I'm hopeful that we can build a new Lisp something like this that will be approachable and hackable, and good for sharing code and runtime across language boundaries. Which would reduce the gap between Lisp and systems programming, or any other domain.

reply

2 points by shader 14 days ago | link

Sounds pretty interesting.

I have this constant problem of dissatisfaction with existing tools and paradigms, to the point that I often work my way down to the bottom of the stack considering building a new OS...

My most recent descent has started with a dissatisfaction of container orchestration tools, then discovering that it's not really easy to manage containers with unprivileged code under Linux, and now wondering about building a microkernel OS / language for distributed actor-model development from the ground up, and thinking it would be nice to have an "OS development framework" so it is easier to experiment with novel architectures without having to deal with a lot of driver development grunt work... I originally asked this question somewhere near the beginning of all that.

reply

2 points by akkartik 14 days ago | link

You're speaking my language :)

Speaking of building a new OS, check out https://gitlab.com/giomasce/asmc which uses some of the bootstrappable infrastructure to build an OS. It uses a stack-based (Forth-like) intermediate language called G to implement C.

reply

More