Arc Forumnew | comments | leaders | submit | conanite's commentslogin
2 points by conanite 5805 days ago | link | parent | on: Rainbow: client-socket

"client-socket-connect" :))

I'm not attached to the name, and have no objections to switching to 'socket-connect. It's only unfortunate that arc's native "open-socket" doesn't proclaim its server nature, so I figured the word "client" would help disambiguate.

-----

1 point by thaddeus 5805 days ago | link

how about: socket-to-em

lol.

-----

1 point by conanite 5820 days ago | link | parent | on: Changing account to "aw"

That's someone else

oh. that's good news.

-----

3 points by conanite 5820 days ago | link | parent | on: Changing account to "aw"

welcome, aw, and congrats on the shiny new 1337 haxxor name :)

what will happen to hacks.catdancer.ws? Do you prefer that people refer to code previously published by CatDancer as "aw's code" now?

And, are you really Pure Evil or is that google mixing you up with someone else?

-----


You might have already seen this

http://docs.google.com/present/edit?id=0AcqSiZ_L33ogZGc5M2Q4...

I presented this at an agile conference in france - many java-family users in audience, so it's likely to be less relevant for you, but feel free to grab ideas/examples/text/whatever

-----

1 point by coconutrandom 5820 days ago | link

ooo I like the dbg macro example...

That's a really nice slideshow, I wish I has seen that first.

-----


I don't know scheme, but it might be for performance. The earliest iterations of rainbow used hashes for global symbols but profiling showed that was a bad idea. Now, each symbol object stores its own value, so there is no lookup, and stuff runs faster.

-----

1 point by zhtw 5822 days ago | link

I don't understand how there cannot be lookup in both cases. The only difference I can guess is that in case of hashes you might have used strings as keys and when using symbols the lookup is done only by pointers. But that's the same in scheme if use use symbols as keys in hash table.

-----

3 points by conanite 5822 days ago | link

zhtw, your profile says you're building a lisp compiler, so I'm taking the liberty of exposing the innards of rainbow a little, it might be helpful:

  public class Symbol {
    String name;
    ArcObject value;

    // ... etc
  }
Pieces of arc code contain direct references to these Symbol objects. For example, (car x) is implemented by something like this:

  class Invoke_Sym_Lex {
    Symbol fn;            // points to the "car" symbol
    LexicalSymbol arg;

    public void invoke(...) {
      fn.value.invoke(arg);
    }
  }
there is no lookup. The symbol is baked into the code. Lexically-bound symbols are more complicated, but they don't use hashes for lookup either.

As far as I can tell, this approach will support namespaces without any performance penalty, except perhaps at read/compile-time. Assuming arc gets namespaces one day ...

-----

1 point by zhtw 5822 days ago | link

Interesting. I'm sure there is no need to do a lookup for symbols in local scope. But we're talking about globals.

What about this:

(eval (coerce "car" 'sym))

-----

2 points by conanite 5827 days ago | link | parent | on: Operator nomenclature

I notice I prefer euphonious names when I need to pick one even though I expect to talk arc rarely or never in conversation. It's probably easier to reason about variables when your brain doesn't have a side process figuring out how to pronounce them. I would run away from "ld" and "lb" for that reason. I would also prefer "fun" to "fn" because I bet there are psychological benefits from reading that word hundreds of times a day. Lots of fun. Could be a major selling point for arc.

-----

2 points by palsecam 5822 days ago | link

> Lots of fun. Could be a major selling point for arc.

Ah ah, I really laughed reading this. And jokes are to be taken... seriously :-D [1]

> I notice I prefer euphonious names

I respect your preference of course, but since we are in a "what's your personal opinion" thread, I'll give mine.

When I think about "fn" in my head it sounds "F-N", like the Unix `ls'/`cd' sound "L-S" / "C-D". I actually like these "saccatero sounds". In English, how do you pronounce "ISP" or "BTW" in conversation? Aren't people saying "bee-tee-double U" sometimes?

---

1: I'm serious here. I'd have probably never got into computers if it was not fun. I'm fond of the acronym jokes ("Gnu's not Unix", the names of the Lisp dialects Nil/T/Eine/Zwei, etc.). I'm in love with the fact my computer is full of daemons, indians (Apache), penguins and the like.

-----

1 point by conanite 5828 days ago | link | parent | on: What I really dislike about arc...

You make a powerful point about cons cells being a more fundamental type than lists. I think if we really wanted english language words to describe the parts of a cons, "left" and "right" would be appropriate for what a cons is in isolation, but would unfortunately be meaningful only if you're using conses to represent binary trees. The beauty of a cons is that it's the smallest possible structure out of which one can build arbitrarily larger composites. And I'm not sure how valuable metaphors from the physical world are when contemplating abstractions - a cons is another degree removed from everyday reality than windows, buttons, dialogs, tabs, and menus are.

-----


  [coerce _ 'cons]:(h . tl)
but ssyntax doesn't do this anyway!

I'm not sure I understand your point about abbreviation; in my example isn't the ssyntax an abbreviation for a let form within the function?

The point you make about homogeneity is important - so maybe the example should be rewritten like this:

  (dfn some (testify.test seq)
    (if (alist seq)
        (reclist test:car seq)
        (recstring test:seq seq)))
The dot ssyntax in this case is just what the caller would have to do if the callee expected a pre-testified arg:

  (some testify.ch chars)
So the choice of dot instead of colon might be better for consistency - it looks like it's just inlining existing code.

I like it less this way, personally - it looks like "testify" is somehow part of the param name, whereas with "testify:test" the two parts seem more distinct, that "testify" is something you apply to "test" before proceeding with the function. But maybe that's just subjective.

-----


oops, typo in copy/paste from console: should read

  arc> (some 'a '(a b c d e)) ; <-- 'a not 'z !
  t
  arc> (some 'z '(a b c d e))
  nil

-----

1 point by conanite 5841 days ago | link | parent | on: Why table ?

I like your definition of table. The only advantage of 'obj is that keys don't need to be quoted. (Although sometimes that's a disadvantage too; the macro quotes them, so keys can't be determined at run-time)

-----

More