mdemare


13 points by mdemare over 2 years ago | link
cached 5 days ago

10 points by mdemare over 2 years ago | link | parent | top
cached 9 days ago
People keep saying that it's unicode is a library issue, but it's not! It's a language issue!

If you move unicode to the libraries, you have to move the string type to the libraries too, assuming strings are lists of unicode characters. And if you move the string type to the library, how can you convert a symbol to a string?

That's not an option, so the alternative is that strings are just byte arrays, ignorant of their encoding, and you need libraries to find out what the length of a string is, and you're back in the tar pit where Ruby and PHP were in 1997 and where they pretty much still are today.

I've been down that road before. I know exactly where it ends.


10 points by mdemare over 2 years ago | link
cached 3 days ago

7 points by mdemare over 2 years ago | link | top
cached 5 days ago
To sum up, Arc wins once, draws three times and loses six times (counting tokens, not characters).

I think the goal for Arc should be to be powerful enough to express all these cases without resorting to expressions (+ - len).

Most obvious improvement - allow negative indices for the second argument. Then you could say:

    (cut s -x)
for

    s[-x .. -1]
Right now, Ruby just has more syntax to express this, e.g. four different forms:

    s[x] ; s[i,j] ; s[i .. j] ; s[i ... j]
Arc only has three:

    (s x) ; (cut s x) ; (cut s i j)

6 points by mdemare over 2 years ago | link | parent | top
cached 4 days ago
I read his announcement and I completely disagree. Strings are pretty basic, and getting them right is part of the work of a language designer. They're more important than macros. Not getting strings right can cripple a language.

And to call not supporting unicode "offensive" is missing the point. Only supporting ascii makes the language less powerful. It means you can't use Arc for solving problems involving text manipulation in languages other than English. That's a big space. Only supporting UTF-8 would make more sense.

And for all the Java bashing nowadays, Java got Strings right, and Perl, Python, PHP and Ruby didn't.


Digging into Arc In 24 Macros Or Less (jfkbits.blogspot.com)
5 points by mdemare over 2 years ago | link
cached about 1 year ago

5 points by mdemare over 2 years ago | link
cached 23 days ago

5 points by mdemare over 2 years ago | link | top
cached 6 days ago
Sometimes, I'm building a list, and want to include an item in the middle only if a condition is true.

    # Ruby 1.8
    insertion = new? ? ['new'] : []
    list = ['hello','brave'] + insertion + ['world']

    # Ruby 1.9
    insertion = new? ? ['new'] : []
    list = ['hello','brave',*insertion,'world']

    # Arc now
    (let insertion (if (is-new) (list "new") nil)
      (join (list "hello" "brave") insertion (list "world")))

    # With @ operation
    (let insertion (if (is-new) (list "new") nil)
      (list "hello" "brave" @insertion "world"))
I think it's worth it.

5 points by mdemare over 2 years ago | link | parent | top
cached 6 days ago
I've started a new thread with cut compared in Ruby and Arc: http://arclanguage.org/item?id=2257

5 points by mdemare over 2 years ago | link
cached 1 day ago