Arc Forumnew | comments | leaders | submit | akkartik's commentslogin
1 point by akkartik 28 days ago | link | parent | on: Does Arc have a language reference?

Indeed, that looks wonderful!

Do you have any open questions?

reply


Thanks for raising these questions! A few random thoughts that immediately occur to me:

My general bias is that CI infrastructure is uneconomic for this project[1], given the amount of effort I'm willing to put into Anarki at this point. But I have absolutely no objection to others continuing to maintain it.

I'd be fine with having a more complex set of instructions for contributors than newcomers. I'm totally willing to perform those commands for myself when I make changes to Anarki.

I'd also be ok with undoing some of this complexity if you want to do that, though I don't mean to push for that in any way.

I think it's also not super onerous to require people to manually update the docs when making changes. That way we can get rid of gh-pages, and configure Github to just rebuild docs from the trunk branch. That eliminates one use case for CI.

Your final proposal is also fine, though as you mentioned someone would have to implement it.. :)

[1] As context, I also plan to remove CI from the project I _do_ actively work on.

reply

2 points by rocketnia 55 days ago | link

I appreciate your frankness, lol. Anarki maintenance happens whenever we feel like it. :-p I have been feeling an inkling of an Arc urge lately, hence this post, but I have other priorities right now that this is basically procrastination from.

What do you mean by getting GitHub to build docs from the trunk branch? That's what that part of the CI script is there to simulate; I think there's still no actual way to configure GitHub Pages to build from anything but a `gh-pages` branch or a `<username>.github.io` repository.

reply

2 points by akkartik 55 days ago | link

A few years ago GitHub added the ability to specify a branch for a project. See the GitHub pages section of https://github.com/arclanguage/anarki/settings

I have a site at http://akkartik.github.io/mu but it's served directly from the main branch. There's no gh-pages branch at https://github.com/akkartik/mu

reply

2 points by rocketnia 53 days ago | link

Oh, I see, you're right. I checked that settings page, but the big blank "social preview" image made me think I was at the end of the page, so I forgot I could scroll down. That's interesting.

reply

2 points by krapp 54 days ago | link

>I think it's also not super onerous to require people to manually update the docs when making changes.

It really isn't. I need to add documentation for a lot of things.

reply

2 points by krapp 54 days ago | link

This is a bit off topic but what happened to the projects tab for the repo? I had a vaguely organized project for the forum up there.

reply

2 points by akkartik 54 days ago | link

Oh sorry, I cleaned up some tabs because I saw tabs overflowing into a menu on the right. I'll restore it.

reply

3 points by krapp 54 days ago | link

Ok thanks.

Also, hey everybody, there's a project tab for the forum on the repo. Feel free to add to it, or whatever.

I'll get around to working on it again sooner or later.

reply


HN discussion: https://news.ycombinator.com/item?id=25603559

reply


New 2-minute video: support for strings, arrays and file handles that starts to give this the feel of a shell language.

https://archive.org/details/akkartik-2min-2020-10-27

-----

2 points by rocketnia 104 days ago | link

Did you build all these dialogue boxes yourself too? Very snazzy. :D

-----

2 points by akkartik 102 days ago | link

https://github.com/akkartik/mu/blob/3d31467c0d/apps/tile/box... :D

-----

1 point by akkartik 127 days ago | link | parent | on: Observations on homoiconicity

You might enjoy this talk which mentions this equation:

    code = AST + formatting/comments
https://www.youtube.com/watch?v=2tCY72t1nL0

-----

2 points by Mitranim 127 days ago | link

I might check it out later, but is there a gist in text form somewhere?

-----

1 point by akkartik 128 days ago | link | parent | on: Observations on homoiconicity

Thanks for sharing! It's been a while since I thought about this, but my conclusion a few years ago[1][2] was that homoiconicity was an ill-posed idea. A language only really needs two properties to make macros convenient:

* Everything is an expression, and

* Unambiguous parens.

[1] http://arclanguage.org/item?id=16924

[2] http://arclanguage.org/item?id=19485

---

That said:

* I like symbols. Having symbols and strings in a Lisp doesn't seem any more weird than having variables and string literals in Algol or Java. Even if I _could_ use one in place of the other, it seems useful to separate symbols as part of the program from strings as part of the environment/domain/data model. You could implement one with the other, sure, but I wouldn't question anyone who chose not to. After all, every attempt I've seen to support spaces in symbols has been quite ugly.

* Your other points seem to be in the context of building tools like code formatters where the output will be seen by humans. That's not really the context for Lisp macros. I haven't really thought much about how useful they would be. Since I believe in macros, I can probably be persuaded. So that might be an interesting post to write. Why do you care about emitting exactly the code that was parsed? What new apps does it enable?

Are you aware of any languages that perfectly reproduce input layout? Even Go supports gofmt only by tightly constraining how programs "should" be indented, and only outputting that layout.

-----

2 points by Mitranim 128 days ago | link

> Why do you care about emitting exactly the code that was parsed? What new apps does it enable?

Got a `gofmt` addiction, can't go back. Auto-formatting should ship with every language.

Briefly skimmed the Go implementation, and you seem to be right: it seems to lose whitespace and enforce its own formatting.

> Are you aware of any languages that perfectly reproduce input layout?

For now just my own. [1] The language isn't real yet, and might never be realized, but it has a base data notation (very Lisp-like), a parser, and I just started writing a formatter. Because the AST for the data notation preserves whitespace and comments, the formatter can print the code _exactly_ as is. This has interesting repercussions.

For a fully-implemented formatter for a fully-defined language, you wouldn't need whitespace; see Go. However, being able to print everything back means your formatter is usable from the start. It can support one or two simple rules, making only minor modifications, but you can use it on real code right away. Furthermore, this means we'll _always_ be able to choose which rules to enable or disable, which can be handy if the family of languages described in terms of this notation has different formatting preferences. I actually want the formatter shipped with the language, like `gofmt`, to be non-configurable, but this still seems like a useful quality.

[1] https://github.com/mitranim/sublime-mox

-----

2 points by Mitranim 128 days ago | link

Should clarify something (follow-up to previous reply, see below or above).

Most macros don't want to deal with whitespace and comments. We also might want to _not let_ them, otherwise people will start using comments as code, like in Ruby. Macros just want expressions. So, we would define a second level of the AST and perform a second pass.

For the same base notation, there may be multiple languages defined in terms of it. If such a language has any form of prefix or infix, or uses the `outside_parens()` calling convention, the second pass would have to group nodes into expressions, in ways specific to that language. Furthermore, it should be addled with metadata about packages, types, and so on. The resulting AST is compiled, fed to macros, etc.

-----


New 2-minute video: defining functions in this postfix language.

https://archive.org/details/akkartik-2min-20201020

-----


That's a great point. As I've built this, the keystone example in my mind has been the `square` function:

    x square = x x *
So it's really funny that I haven't added it yet. Now added.

-----

2 points by zck 138 days ago | link

Nice!

Is it that you're trying to reduce stack juggling? That's hard to understand from simple examples (that you need to have to grok the syntax). Maybe compare something like finding the hypotenuse of a right triangle given the two other sides. Without naming arguments, you'd have to do something like:

  hypot = dup * swap dup * + sqrt
But with named arguments:

  hypot x y = x x * y y * + sqrt
That seems a little easier to read, but even the original isn't so complicated. Is there an example that makes it more obvious why it's better? Even your `square` example is more tokens than with stack juggling (without arguments, `square = dup *` is just four tokens, compared to six with named arguments). I'd say the with-arguments one is easier to read, but I've far less familiar with stack-based postfix programming.

-----

2 points by akkartik 137 days ago | link

Yeah, some other polynomial might be a better example. The Pythagorean formula has a clean separation when it comes to which args each term uses. How about the roots of a quadratic equation when you start out with a, b and c on the stack?

-----

2 points by zck 137 days ago | link

Yes, that is definitely simpler, although the formula is more esoteric. At least, for me, it triggers the "I was taught this in school and haven't used it since" filter.

Maybe something like:

  total-price cost-per-item number-of-items shipping-cost-per-item rush-cost = cost-per-item number-of-items * shipping-cost-per-item number-of-items * + rush-cost +
This doesn't seem super great; it could be refactored to use each thing once, but it's late and I can't think of any better example.

-----

2 points by akkartik 137 days ago | link

You're right that in general any such example can be refactored to reduce stack operations. That's even a fun game for many Forth programmers to play. (We lispers have our own equivalents.) But it usually makes the code less comprehensible, in my experience.

-----


I've been hanging out on the Handmade Network Discord channel recently. Mostly because I've developed RSI so can't work as much on Mu, and because I'm bored staying home for months on end.

https://handmade.network/manifesto

The site seems to be some sort of offshoot from a channel where a game developer used to screencast himself developing a game: https://handmadehero.org/watch

From what I can piece together, Handmade Network periodically has some sort of Jam for a few days where a few people hack on projects following some theme.

The most recent theme was Lisp: https://handmade.network/blogs/p/7390

Flip was built for the Lisp Jam. You can see a demo about it here: https://discord.com/channels/239737791225790464/485261036308... (though you'll need to sign up to that Discord group)

There was a discussion about it, a sort of debrief after the Jam, that you can read at https://discord.com/channels/239737791225790464/707742863076....

It's already sparked a bunch of ideas for me: https://mastodon.social/@akkartik/104780599045128839. So decent payoff on being bored and finding this community :)

-----

2 points by jsgrahamus 177 days ago | link

Sounds interesting. Sorry about the RSI. Went to using an ergonomic keyboard, which seems to have squelched it for me.

-----

2 points by akkartik 191 days ago | link | parent | on: Still alive?

It's still running HN :)

Previous thread: http://arclanguage.org/item?id=21205

Edit: Another thread from 5 years ago: http://arclanguage.org/item?id=19408

-----

More