Can you give more details? Do you have some prior programming experience? Do you mean in-person, in a classroom, online or something else?
I spent some time teaching programming using arc (might not be what you're asking for): http://arclanguage.org/item?id=19039. However, after some time I ended up moving away from arc: http://akkartik.name/post/mu. If you have some programming experience already, though, that might not be for you either.
"We can't parse ... unless we know all the operators that it uses."
Yes, that was my reaction as well. I thought https://en.wikipedia.org/wiki/Polish_notation requires either a clear separation between operators and values (so no higher-order functions) or all operators to be binary. Parentheses (whether of the lisp or ML or other variety) permit mult-iary higher-order operations.
Also, doesn't https://en.wikipedia.org/wiki/Shunting-yard_algorithm require some sort of delimiter between operations? I thought it didn't work for nested operations without commas or parens, or the simplifying assumptions in the previous paragraph.
I think those simplifying assumptions are consistent with what dagfroberg was saying. I think "Polish notation" and "shunting-yard algorithm" make sense as terminology here, even if dagfroberg and I might each have slight variations in mind.
---
"so no higher-order functions"
I think we can get read-time arity information for local variables, but only if our read-time arity information for the lambda syntax is detailed enough to tell us how to obtain the arity information for its parameter. For instance...
-- To parse 3: We've completed an expression.
3 =:: Expr
-- To parse +: Parse an expression. Parse an expression. We've
-- completed an expression.
+ =:: Expr -> Expr -> Expr
-- To parse fn: Parse a variable. Parse an expression where that
-- variable is parsed by (We've completed an expression.). We've
-- completed an expression.
fn =:: (arg : Var) -> LetArity arg Expr Expr -> Expr
-- To parse letArity: Parse a variable. Parse an arity specification.
-- Parse an expression where that variable is parsed by that arity
-- specification. We've completed an expression.
letArity =:: (arg : Var) -> Arity n -> LetArity arg n Expr -> Expr
-- To parse arityExpr: We've completed a specification of arity
-- (Expr).
arityExpr =:: Arity Expr
-- To parse arityArrow: Parse a specification of some arity m. Parse a
-- specification of some arity n. We've completed a specification of
-- arity (Parse according to arity specification m. We've completed a
-- parse according to arity specification n.).
arityArrow =:: Arity m -> Arity n -> Arity (m -> n)
-- ...likewise for many of the other syntaxes I'm using in these arity
-- specifications, which isn't to say they're all *easy* or even
-- *possible* to specify in this metacircular way...
This extensible parser is pretty obviously turning into a half parser, half static type system, and now we have two big design rabbit holes for the price of one. :)
Notably, Telegram's binary protocol actually takes an approach that seems related to this, using dependent type declarations as part of the protocol: https://core.telegram.org/mtproto/TL
For hosting there's tons of cheap unix VPS providers. Not much differentiating them; just go with one, and you can switch if you don't like it. Start with https://linode.com or https://www.digitalocean.com.
Nice! I should warn you that arc is very deeply permeated with the assumption that there's only one thread of execution. See atomic, for example, which all the assignment operators use: https://arclanguage.github.io/ref/atomic.html. Couple with the statement that "The distinction between “future safe” and “future unsafe” operations may be far from apparent at the level of a Racket program," (http://docs.racket-lang.org/guide/parallelism.html) and I think you might be in for some interesting debugging times :)
Hmm, future-event seems like it's just for performance logging? Maybe ignore it for now and try to build something non-trivial with the primitives you have?
(There's a password for my mail delivery service in that repo, but that account is now defunct. Hopefully nothing else is confidential. Please be nice and let me know if you see something there that might damage me :)
Thanks, I didn't see anything suspect. It should be a good learning experience calling c from Anarki. I saw a tutorial today how to create c callable functions using NASM x86-64 assembly code and it worked. Do you think assembly and Anarki can talk to each other through c?
If you're into assembly I'd love to hear what you think of my current project to teach programming using a sort of idealized assembly: http://github.com/akkartik/mu. I'm co-designing the assembly language with the OS around it, in the spirit of C+unix.
The project looks interesting. I would like to learn more about assembly to, have greater understanding and control over what my computer actually does. All the tests passed but I made mu crash using repl.mu, if this help in finding bugs?
./mu repl.mu
ready! type in an instruction, then hit enter. ctrl-d exits.
(+ 1 1)
missing type in {name: "1", properties: ["1": ]}
mu: 041name.cc:82 bool disqualified(reagent&): Assertion `!x.types.empty()' failed.
Aborted (Core dumped)
Also my left, middle and right mouse button clicks were printing rubbish to the terminal after that. I restarted the terminal and mouse functionality was normal again.
Thanks for trying it! It's not actually a Lisp :) Check out the examples in the readme.
The repl is sadly not done. Repl feels like the wrong metaphor. I'm writing on a more useful version in edit.mu, but that's far from done. For now sadly you have to type code into a file and run it as a separate step. Just for a couple more weeks, hopefully.
Impressive project, how long have you been programming for? I'm not sure if I can be of much technical assistance but if you recommend a few tools I could probably learn more about testing and find bugs. Earlier this week I installed valgrind to check for errors and memory leaks and I'm looking for a debugger that will work with lubuntu. I am also learning assembly.
I'm starting to feel old :) I've been programming for 16 years now.
Feel free to ask me more questions. I'm not looking for help, rather to help. But there's still some way to go. In the meantime I'll help in any other way. Valgrind is super useful for C programming.
Hmm, looking at the implementation, 'alet is a utility for wrapping a lambda to do various things:
a) The letargs let you set up some bindings the function can refer to.
b) The body lets you do some things with the function in scope before returning it.
c) It wraps the function in a mutable binding named 'this, and it actually returns another function that dereferences this binding and calls whatever's inside. That way you can dynamically replace the entire behavior of the function by assigning to 'this.
So it seems to be geared for a certain object-oriented style where objects have a) private fields, b) a programmable constructor, and c) a private "become" operation.
It looks like 'dlambda is some kind of a multi-branch, destructuring lambda. In this context of this object-oriented style, it effectively lets your object have multiple methods.
Thx, i had found this [1], but what i really need is a toptable/topic like https://news.ycombinator.com/show (which is diff from 'about' page. (A story whose title begins with "Show HN" goes to /show. FYI [2]))
Arc/anarki is more minimalist than common lisp and won't warn you about unused variables, so I think the answer here is: nothing :) Here's the equivalent macro in anarki:
(mac tree-leaves (tree test result)
`(tree-leaves%% ,tree ,test ,result))
Might as well call the function directly :)
(And no, this wasn't asked before. I'd never gotten past the first couple of chapters of letoverlambda. Maybe I should go back to it.)
Hey thanks for saving me further embarrassment. If I were to ask another question should I start another thread? In particular I am trying to translate to arc a matching function in Paul Graham's On Lisp, Fig 18.5. After this I am hoping to learn about Query Interpreters Fig 19.3 and Query Compilers Fig 19.6