10 ms·
Urbit language tutorial, chapter 0
- SolarNet 11y agoLong story short, this quote: > Lisp masters beware: Hoon [a b] is Lisp (a . b), Lisp (a b) is Hoon [a b ~]. ~ means nil, with value zero. Lisp and Hoon are both pair-oriented languages down below, but Lisp has a layer of sugar that makes it look list-oriented. Hoon loves its "improper lists," ie, tuples. along with the knowledge that the people writing this like really strange names (tile, gate, vase, fish) and 2 part symbols (++ += =^) is all you need to know.
- kazinator 11y ago> 42 and 0x2a are actually the same noun, because they're the same number. [...] But semantically, 42 has a decimal span and 0x2a hexadecimal, so they print differently. A babbling load of twaddle which in and of itself wouldn't be a crime were the word "semantically" not involved as an abuse victim.
- deleted 11y ago[deleted]
- sdegutis 11y ago> Lisp and Hoon are both pair-oriented languages down below, but Lisp has a layer of sugar that makes it look list-oriented. You know, I always wondered about where we should draw the line when describing Lisp as a language family vs. Lisp the original reference implementation, vs. Lisp the originally popular implementation (either CL or Scheme, take your pick). Because I think most people agree that Clojure is a valid Lisp, yet it's not based on pairs like Lisp traditionally is.
- ptc 11y agohttp://this-plt-life.tumblr.com/post/64150676855/when-i-try-to-find-out-something-about-urbit http://this-plt-life.tumblr.com/post/64150676855/when-i-try-...
- MichaelGG 11y agoReally should lead with an end example then deconstruct how it works. But I get the feeling they are trying to be intentionally obtuse, either to show off cleverness or as performance art. Perhaps that's a bit cynical.
- gclaramunt 11y ago>But I get the feeling they are trying to be intentionally obtuse, either to show off cleverness or as performance art Same here. I really don't see the point of renaming well known and defined concepts
- pcmonk 11y agoWe're not trying to be intentionally obtuse. In general, we try to only create new names when the old names are for a sufficiently different concept. Perhaps we go slightly too far in doing this, but much of the "the terms are alien" feeling comes from the concepts beings actually different than you're used to. This is the start of a bottom-up style tutorial, but if you're interested in a top-down tutorial, may I suggest this one from one of our open-source contributors: http://hidduc-posmeg.urbit.org/home/pub/hoon-intro/ http://hidduc-posmeg.urbit.org/home/pub/hoon-intro/
- Avshalom 11y agoWell I mean of course you have to say that, kinda ruins the joke if you keep elbowing people and going "pretty clever of us eh?"
- cwyers 11y ago> In general, we try to only create new names when the old names are for a sufficiently different concept. You renamed the godforsaken PUNCTUATION, man. What exactly is the different concept behind an equals sign in Urbit that you have to call it tis? Or the colon, what conceptually did you change about the colon that it's got to be a col or the comma that it's a com?
- 11y ago
- ThrustVectoring 11y agoThe "navigate to top" links in the upper left kept appearing and disappearing as I moved my mouse and scrolled around, and it's extraordinarily distracting to me.
- incepted 11y agoDitto. I even moved my mouse cursor on the right side of the window, hoping it would stop. It didn't.
- ThrustVectoring 11y agoI just remembered that you can right-click it in Chrome and delete it from the DOM.
- incepted 11y agoKeep forgetting that, thanks for the reminder.
- state 11y agoYeah, you're right. Was something that sounded good, but is actually just distracting. I'll take it out.
- deleted 11y ago[deleted]
- xixixao 11y agoTududum, anyone's got it cached (Google has some JS only)? %exit /~zod/home/~2015.10.17..20.34.57..3a55/arvo/eyre/:<[1.104 9].[1.106 38]> [%bad-beam %home] /~zod/home/~2015.10.17..20.34.57..3a55/arvo/eyre/:<[1.103 9].[1.106 38]> /~zod/home/~2015.10.17..20.34.57..3a55/arvo/eyre/:<[1.102 9].[1.106 38]> /~zod/home/~2015.10.17..20.34.57..3a55/arvo/eyre/:<[1.101 9].[1.106 38]> /~zod/home/~2015.10.17..20.34.57..3a55/arvo/eyre/:<[1.100 9].[1.106 38]>
- ajkjk 11y agoI'm finding this tutorial really hard to follow. It doesn't track my mental state very well; each successive sentence that qualifies an idea doesn't follow from the last one to me. I'm struggling to describe this phenomenon exactly, but I want to try because I'm interested in quantifying it. So here's an attempt: When I'm reading a tutorial to a new idea, a qualification needs to follow naturally. If you tell me "this is an A", and then follow it with "note: it's not a B", that qualification only works if I would have thought, in my head "oh, is it also a B?" after the first sentence. Otherwise, I'm left in a tough spot: I believe you that it's an A, but I don't trust that I know what an A is, because I'm apparently supposed to have realized that that suggested it could have been a B as well - because you just jumped in and pointed out that it wasn't! So such a qualification is not just a clarification; it's also narrowing down the possible meanings of A. But I didn't know about all those meanings, because all I have is the word 'A' right now, and I don't understand the complexity of that yet. Here's a specific example: "A noun is an atom or a cell. An atom is any unsigned integer. A cell is an ordered pair of nouns. The noun is an intentionally boring data model. Nouns don't have cycles (although a noun implementation should take advantage of acyclic graph structure)." As of sentence #3, it looks like a noun can contain cycles. I mean, it can be a cell, and a cell can contain nouns, so that seems like a cycle. Then, in sentence #5, I'm told they don't have cycles. What? Now I don't know what to believe. I thought I understood nouns, but I don't anymore. Then, in the parens, even more concepts are thrown in. Now we're talking implementations - but I don't know what we're implementing. And we're taking advantage of acylic graph structures. Taking advantage? To do what? And the word 'although' shows up. They 'don't' have cycles, 'although' we should take advantage of their not having cycles? Either this is mis-worded or there's even more context I'm missing. .. anyway, that got wordy. Point is, almost every sentence in this article confuses me further, instead of confusing me less. There are no 'ah-ha' moments. It's just "huh?" after "huh?".
- urbit 11y agoThanks for the detailed feedback! As of sentence #3, it looks like a noun can contain cycles. I mean, it can be a cell, and a cell can contain nouns, so that seems like a cycle. Then, in sentence #5, I'm told they don't have cycles. What? If we used the word "tree" and "leaf" here instead of "noun," would that help? "A tree is a leaf or a cell. A leaf is any unsigned integer. A cell is an ordered pair of trees." It doesn't strike me that anyone reading this definition, even not knowing what a "tree" and a "leaf" are, would assume that a tree can have cycles. And then, two sentences later, if we say that a tree doesn't have cycles, I'd hope that that would settle the matter. It's probably a mistake to bring implementation issues (like the fact that you can share a pointer rather than copying a subtree, thus creating a DAG [1]) into a discussion of this level, though. All kinds of people have different kinds of CS backgrounds... [1] https://en.wikipedia.org/wiki/Directed_acyclic_graph https://en.wikipedia.org/wiki/Directed_acyclic_graph
- deleted 11y ago[deleted]
- kzrdude 11y agoIt looks like urbit isn't really “public” yet; they claim to be in “semi-closed alpha” still.
- state 11y agoIt's actually more open than it looks. The code (https://github.com/urbit/urbit https://github.com/urbit/urbit) is available to anyone interested. Anyone can build and run a comet.
- RexM 11y agoCan you explain what a comet is, exactly? If I were to setup my own "comet" would that mean that I'd have my own network, detached from the one the urbit developers are a part of? I'm interested in playing with urbit, but I'd also like to try it with some people to talk to, and not on my own island.
- state 11y agoA comet is an Urbit with a self-signed certificate. You're a part of the same network that everyone else is on. Comets are one of 2^128 possible addresses, so they're anonymous and disposable. For the time being it's possible to use a comet to come and talk with everyone. We're also glad to answer questions over email.
- RexM 11y agoThanks for explaining this. So invites are only for "planet" names? I'm still having difficulties understanding the reasoning behind the different levels, explained in the white paper. I've got it running, thanks for letting me know that I could just compile it and spin it up. I've been getting the newsletters for urbit and have been wanting to play with it. I didn't realize I could do that without an invite.
- theseoafs 11y agoAll of this can be neatly summarized as "a noun is either an unsigned integer or a pair of two nouns". The authors apparently love to give things funny names and weird syntax, but there's nothing here that Lisp didn't do 50 years ago. Let's see what happens in chapter 1, though.
- urbit 11y agoYes! Although there are some things Lisp did 50 years ago, that aren't here. But this is less an improvement on Lisp, than a tribute to Lisp. Chapter 1 should remind you less of Lisp. Although I do expect to hear "that's just caddadr"...
- powera 11y agoSo basically this is a lot of syntax to add something resembling a type-system on top of a fundamentally un-typed language?
- urbit 11y agoYeah, that's pretty accurate.
- powera 11y agoPossibly a silly question: did you consider using the complex integers (either as a + bi, or as (r, 2*pi/T)) instead of the natural numbers as the basis for Nock?
- urbit 11y agoCells make you think of a+bi a little bit, but no. (Actually I was very pleased when I realized that signed integers have no place in a fundamental interpreter.)
- gclaramunt 11y agocurious: what's the underlying computational model for the language? the untyped lambda calculus? universal turing machine ? Or there's something new?
- urbit 11y agoNock: http://urbit.org/docs/dev/nock http://urbit.org/docs/dev/nock
- openasocket 11y agoTwo pieces of feedback: First, at the end of this I'm still rather confused about what molds are for, and it's implied that all will be explained in the next chapter. This is a tutorial, not the next great American novel: do not end chapters on cliffhangers! After finishing a chapter, the reader should be able to go back and fully understand every concept introduced in the text. Either expand this chapter to include a complete explanation of molds, or move molds into a separate chapter. Two, you include this example of a mold: ++ span $% [%atom p=@tas] [%cell p=span q=span] [%cube p=* q=span] == This is chapter 0 of a tutorial on Hoon: do not just include Hoon syntax with no explanation! I have some idea of what this function does from context clues, but I have no way of knowing if my intuition is correct. This is why pseudocode was created: use it! Here's my best guess of what that function does: function span_mold(noun n) if n is of the form (p,q) return [%cell span_mold(p) span_mold(q)] else if n is of the form @a return [%atom %a] else if n is of the form %b return [%cube b span(b)] Is that right? I have no clue!
- urbit 11y agoIt is right! You do have clue! This is excellent feedback. Normally I'd agree with it. Ideally, this will be the last cliffhanger in the tutorial...
- deleted 11y ago[deleted]
- mcnamaratw 11y ago"FP for street programmers" sounds like a win. Unfortunately I couldn't really understand anything else. My Lisp is rusty, but dotted pairs aren't something I usually have so much trouble following. Is there a tutorial that's mostly code examples and not so much text?
- urbit 11y agoThe next tutorial is a lot less wordy, and should hopefully shed a good amount of light backward on this one.
- stevegh 11y agoIf you want to know what he is actually talking about, this may help: https://popehat.com/2013/12/06/nock-hoon-etc-for-non-vulcans-why-urbit-matters/ https://popehat.com/2013/12/06/nock-hoon-etc-for-non-vulcans...
- dragonbonheur 11y agoSome languages are so disconnected from programmer needs and real life usefulness that they make me say "I'd rather learn assembler".
- tel 11y agoHow in the world do typeclasses work in Hoon?
- loqi 11y agoI don't think Hoon's type system actually has a typeclass analogue. As far as I could tell, what it has is something like generics, but in a world where everything is ultimately a noun. IIRC, a previous iteration of the docs explained that "wet gates" (generic functions) are actually required to compile down to the same Nock when "instantiated" at a particular argument, modulo dead code elimination. Didn't look much like ad-hoc polymorphism to me. A good example is Hoon's maps[1]. They're parameterized on type, but I'm pretty sure those types can't affect the runtime behavior by, say, specifying their own hash or comparison function. Instead, the map implementation[2] hardwires a couple of specific comparison functions[3] that effectively toss the type information and work in terms of the raw underlying nouns. It is kind of weird that every type carves out a subset of nouns, even function types (or function "molds" or "spans" or whatever... I'll stop calling them types when the Urbit people stop calling it a type system). Hoon's C-flavor really shows when it makes the likes of strlen((char*)strlen) expressible in a purely functional way. [1]: https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoon.hoon#L421-L422 https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoo... [2]: https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoon.hoon#L2530-L2751 https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoo... [3]: https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoon.hoon#L1006-L1034 https://github.com/urbit/urbit/blob/7186219/urb/zod/arvo/hoo...