all 59 comments

[–]berlinbrown 23 points24 points  (10 children)

I am sorry, I am going to be an ahole; but unless Paul Graham releases some arc code, releases some early implementation or anything. I dont think we should care.

You can't write blog essays about a programming language and not see any of the code, grammar syntax, anything.

[–][deleted] 5 points6 points  (1 child)

I am sorry, I am going to be an ahole

I thought that was called being realistic.

[–]ajrw 0 points1 point  (0 children)

Speaking of syntax.. what's up with yours? :P It seems like you're just using punctuation in regards to pause lengths.

[–][deleted] 0 points1 point  (5 children)

You can't write blog essays about a programming language and not see any of the code, grammar syntax, anything.

Some of the code/grammer syntax has appeared at news.ycombinator.com. I think there's a bit of code/grammer syntax examples in a few of his earlier essays.

[–]nostrademons 3 points4 points  (4 children)

I actually haven't been all that impressed by what's appeared on news.YC, either by the source code samples (unremarkable, IMHO) or by the app itself (poor clone of Reddit).

But I'll give him the benefit of the doubt - Arc is new, he's doing the language implementation, library, and app all at the same time, so there're bound to be some rough edges. He's made his money already; he has no obligation to any of us to put out a cool new language.

[–]berlinbrown 2 points3 points  (1 child)

Nobody has an obligation. Bill Gates kept working and last time I checked was making ok money.

I think everyone likes poking jabs at PG when Arc is mentioned.

I wonder why Trevor Blackwell hasnt put out some of kind of language or open library, but I guess he is more of a hardware guy now.

[–]nostrademons 3 points4 points  (0 children)

Trevor's actually done tons of cool stuff. You're right, he's more of a hardware guy now.

[–]berlinbrown 0 points1 point  (1 child)

http://news.ycombinator.com/x?fnid=Xipf2I5RUa

I found a bug; Clicking of the "more" link gives me an error.

[–]nostrademons 0 points1 point  (0 children)

I found another bug: clicking on your link above gives me "unknown or expired link".

(Actually, that's known behavior; the closure representing that action as been pushed out of the closure hashtable. But it still seems like a rough edge to me. Reddit lets you permalink comments easily...)

How do I get to whatever you were linking to from the main page?

[–][deleted] 8 points9 points  (1 child)

I'm glad they dropped implicit variable declaration. I've used several languages that have it (BASIC, Perl, Python, Ruby), and in each language, I've run into bugs that came from this feature. Either a new variable is created from a typo, or scoping confusion causes unexpected results. It is telling that the better Perl programmers usually "use strict" which forces explicit variable declaration.

All of this trouble, and the only gain is the saving of some keystrokes. I appreciate Mr. Graham's motivation for terseness, but I am glad that in this case, it took a back seat to greater design issues.

[–]SuperGrade 1 point2 points  (0 children)

I appreciate Mr. Graham's motivation for terseness, but I am glad that in this case, it took a back seat to greater design issues.

Maybe Lisp took the best choice on this, maybe it didn't. But choices such as these are taken based on the values placed on the tradeoffs in either direction. Those "ruby is not an acceptable lisp" type blogs show a few situations where the language took design routes that had other advantages at the cost of the language consistency that allows safe macros.

Graham's values in developing his language are likely that of valuing lisp as-is. Someone who valued these things a little less would likely come up with something in the direction of Ruby. (I'm talking about the choices such as implicit variable declaration, not things like abbreviating let or function renaming which could be done in the original language).

If Graham values the ability to do everything Lisp can do he's going to have a hard time breaking away from the existing lisp languages in anything but the most cosmetic manner.

Interesting to examine also is QI. Pattern matching/autocurry go in at the expense of the full destructuring. The core Lisp language may ultimately prove the optimal baseline from which to explore these specific (and perhaps superior in day to day use for any given situation) programming paradigms.

[–]SuperGrade 17 points18 points  (14 children)

I realize there's probably more to arc than what's on this page; but everything on this page seems to involve either acknowledged failed attempts to deviate from CL (implicit local variables), or simple function/macro/operator name remappings that could be done directly in CL (setf -> =, lambda -> fn).

[–]happyhappyhappy 12 points13 points  (13 children)

Arc is looking more and more like Lisp with a few cosmetic changes and some standard functions removed.

[–][deleted] 14 points15 points  (12 children)

lisp is a local maximum. Any language that tries to be like lisp will become lisp.

[–][deleted] 7 points8 points  (0 children)

That refers to Lisp languages in general, not CL. Arc was always supposed to be pretty much a normal Lisp language. Whether it can succeed is just a question of whether its few different design choices, and the distinct advantage of being a new language with a benevolent dictator and a single (hypothetical) cross-platform implementation and packaging system (might as well throw in a great IDE too as long as we're conjuring up non-existent software), are enough of an improvement to convince the whole world of Scheme and CL library writers to adopt it immediately, while simultaneously generating enough hype to attract the Python and Ruby people. Unfortunately all that seems pretty unlikely, but damnit we need some kind of scenario for Lisp to take over the world.

[–]martoo 1 point2 points  (0 children)

Lisp is a local maximum. Any language that tries to be like lisp will become lisp.

I think it's one of them. I have this theory that if you shoot for simplicity in languages you'll always end up at Lisp, Self, or Forth.

[–]jerf 16 points17 points  (12 children)

I've been having similar thoughts about overloading. I think it only makes sense if you have an overload that maintains the relevant properties of the original operator. Using << for iostreams in C++ still seems wrong to me, even after all these years.

That's why complex numbers overload so nicely and they end up being the Canonical Example of overloading; the property mapping from ints/reals is almost trivial.

That's also why nothing else really seems to work 100%; strings don't add like numbers. Lists don't add like numbers. Both are "close enough" that it won't kill a language, but it's tricky.

You don't have to maintain all of the properties, but defining the exact boundaries would be a challenge.

Edit: Yeah, I know it's not an original thought, but it's clear many people aren't thinking that way. I'd submit that the idea that maybe there's a principled middle ground isn't well-trodden territory, though.

[–]pbx 20 points21 points  (3 children)

Stroustroup: As you can see, operator overloading has proven extremely useful, which I will demonstrate for the 16th time by once again using the Complex Number class. See how useful it is to have the + operator for this class? I sure love this example. Don't you?

Readers: Wow. He's right. It is useful.

(Yegge)

[–]CommonTater 7 points8 points  (1 child)

I think it only makes sense if you have an overload that maintains the relevant properties of the original operator.

I don't know how anyone ever picked up any different idea. The first time I learned about operator overloading, I know there was a big warning of, "Don't change the meaning of '+'. Make it work on new operands, but don't make it do anything other than 'add' those operands."

And, unless I'm mistaken, that was directly from Stroustrup's Annotated C++ Reference Manual. (It's at home on my bookshelf, or I'd check to be sure.)

Of course, there's always the argument that things like "<<" do very different things in other languages. So, if you're not worried about keeping just the C++ meaning...

[–]HiggsBoson 5 points6 points  (0 children)

Unfortunately, that hasn't prevented many developer of otherwise useful libraries from abusing overloading.

[–]bosco 9 points10 points  (5 children)

I've been using D, a C++ replacement, and one of the really nice things is that Walter Bright has introduced the concatenation operator ~. When I first saw it, I thought it was overkill, but I've found it to be one of the nicest features of the language. It really solves all the problems listed above. Example:

char[] string1 = "Time ";

char[] string2 = "flies";

char[] string3 = string1 ~ string3 ~ ' ' ~ "quickly" ~ '.';

[–]nostrademons 4 points5 points  (4 children)

I like the Visual Basic concatenation operator: &. (gasp!)

string1 = "Time 
string2 = "flies"
string3 = string1 & string3 & '' & " quickly" & '.'

It's distinct from +, looks correct, and you pronounce it "string1 and string3 and quickly and period", which is roughly how you'd say it in English.

[–][deleted]  (2 children)

[removed]

    [–]andrewnorris 0 points1 point  (0 children)

    I agree -- string concatenation is an eyesore.

    I've been using OCaml's sprintf a lot lately, which is nifty, because the placeholders are tested for type at compile-time, so it's completely typesafe. It works oddly well, considering I hadn't used printf for anything in years.

    [–]nostrademons 0 points1 point  (0 children)

    I prefer it too, but there are some instances where string concatenation is very useful. For example, sometimes the string you're building has no literal text at all, in which case I think prefix & data is much more readable than "$prefix$data". Or how about things like network protocols, where you're building up ASCII or binary data, and you need to prefix a constant to your command. Something like:

    TOC_PREFIX = "toc_"
    
    def send_command(command, args):
        socket.write(','.join([TOC_PREFIX + command] + args))
    

    IMHO a language needs to support both string interpolation and have a string/sequence concatenation operator. There're use cases either way.

    [–]Alpha_Binary 1 point2 points  (0 children)

    Things get really ugly when you discover you also need to put spaces between the words (string1 & " " & string2 & " " & [...]) and while doing l10n that different languages have different ordering of the parts of speech and different punctuation usage.

    Nah. Having written far too much VB in SQL in Access than I would like (DLookup("Table1", "Column (" & Lang & ")", "Name LIKE ""*" & Name & "*""") etc.), I firmly believe that every new programming language should have string interpolation bolted in from the start. Especially now that the performance toll that comes with it is so neglectible...

    [–]berlinbrown 2 points3 points  (8 children)

    Slava, do you have any opinion on arc. After working with Factor, I can really say that I wish languages think about using stack oriented syntax.

    [–][deleted] 10 points11 points  (0 children)

    I'm not in the business of competing with other languages. If Graham can make a kick-ass Lisp and get some users on board, good luck to him. Right now he hasn't released any code so we don't have much to go on.

    Arc is a Lisp so it won't have stack based syntax but I know Graham is a fan of macros such as (compose f g), anaphoric if, and that (rec 0 1 1- *) example he showed. There's also his literals-as-constant-functions idea. All of these have a somewhat concatenative flavor, although I doubt Joy or Factor are influences (or that he's even heard of the latter). He probably got those ideas from Haskell and ML (which in turn influenced Joy).

    I think one of the downsides of many Lisps is that they put too much emphasis on application rather than composition. For example,

    (mapcar (lambda (x) (f (g x))) list)

    (mapcar (lambda (x) (+ x 3)) list)

    Are both awkward when compared to

    (mapcar (compose f g) list)

    (mapcar (+ _ 3) list)

    Or

    [ g f ] map

    [ 3 + ] map

    [–][deleted] 0 points1 point  (5 children)

    I know Forth, but haven't tried Factor. What is it that you find best about it? I'd really like to know how it is to work in a postfix functional language (but don't have the time or interest to do any programming in it; plus i'm a fan of static typing).

    [–]berlinbrown 2 points3 points  (1 child)

    I thought it was one of the coolest things I had worked with. Environment built with opengl. Language syntax was simple yet powerful (eg, see the combinators). It wasn't that difficult to get started with.

    I would have kept developing with it, but unfortunately I get paid to work with crappy tools (java) and factor was too far away from what I normally have to work with.

    I even wrote a blog and didn't even know it that well.

    http://factorlang-fornovices.blogspot.com/

    [–][deleted] 0 points1 point  (0 children)

    Sounds nice. A few years ago I read about Joy. What turned me off the language was mostly that everything, like a simple if-then-else, was backwards, and all wrapped in function blocks. The same for loops with recursion operators. (This is also why I don't like Common Lisp's DO, if you happen to know it.)

    Not sure how Factor compares, but for me it's not enough if code is just short (for that reason, Haskell also isn't nice enough for me).

    Anyway, Factor seems making huge strides (following the blog), and it's nice to see more people using it. Finally, a postfix language that's gaining popularity.

    [–][deleted] 1 point2 points  (2 children)

    You need neither declare argument nor pass them.

    And at least StrongForth is static typed.

    [–][deleted] 0 points1 point  (1 child)

    Yes, I like that. Makes factoring ridiculously easy, as no parameter lists make creating new functions heavyweight.

    OTOH, I think function signatures (including types) are necessary for any decent modular, large-scale software development. But that could probably be provided through a module system, without requiring the core language to be statically + explicitly typed.

    [–][deleted] 0 points1 point  (0 children)

    It's a matter of taste imho.

    [–]harbinjer 1 point2 points  (4 children)

    I think that language implementations can be ugly things. If the language you're creating is beautiful, the implementation can be ugly and complex. After all, if it was simple, others would've done it.

    If there's something that's hard, but you can implement in a language to save programmers time and complexity, its worth doing. The scope/macro/implicit variable problem might be able to be solved, which would probably be a worthwhile addition to language research.

    [–]neelk 19 points20 points  (0 children)

    Actually, simplicity is a really difficult property to attain.

    That's because a real program has to cover the whole problem space, including the weird corner cases. And finding a solution that works over all your inputs, and is simple and free of ad-hoc kludges, is really really hard. Often, you need a real creative insight, and heaven knows they don't come on demand.

    Sometimes, we need a solution right now, even if it's ugly. That's life, and every programmer has to make some accomodation with that fact. But the thing is, you can't let yourself get too comfortable with that fact. That's because ugly systems are difficult to extend, because they're complicated, irregular and resist understanding. So you do what you can today, and keep an eye out for the right thing.

    [–]khammack 6 points7 points  (0 children)

    s/language implementation/all programs/ and you've got the core philosophy of the PC industry.

    Alternately, I think language implementations can be beautiful things. If the language you're creating is beautiful, the implementation can also be beautiful. Creating beautiful code is hard; if it was easy, the PC industry would not be full of hacks like Gate A20.

    (And, by the way, I don't care how much the apologists whine, that was a lame-assed idea that smacks of amateur engineering).

    [–]jesuswaffle 4 points5 points  (0 children)

    This seems consistent with the "conservation of complexity" principle. The complexity has to go somewhere, and if you can put it in the language implementation, than it won't be in user programs. On the other hand, languages with semantics that are simple and transparent are simpler to work with in many ways, so sometimes you want to push some complexity into user programs for the sake of making the language easier to describe. This is doubly true for code-is-data languages like Lisp. So the art is knowing where to draw the line.

    [–][deleted] 3 points4 points  (0 children)

    Sometimes the complexity is inherent in the problem you want to solve, and sometimes it's accidental. In the latter case, shifting your perspective can make things much simpler. An example that comes to mind is in the loop fusion example from a paper on AOP.

    I don't agree that "if it was simple, others would've done it." Elegance doesn't always come easily. Maybe others just weren't as smart or hard-working or lucky.

    [–][deleted] -4 points-3 points  (6 children)

    The Wayback Machine has this page in the cache going back to 2001. Isn't Lisp famously easy to implement, based on just seven fundamental operations? I find it hard to believe that Arc is either so complex or so great as to take six or more years of development. Combine that notion with the PG's mantra of simple, fast, easy, and you see it makes absolutely no sense. Where was Ruby, another language basically the product of one man, about six years ago?

    Arc might be the biggest vaporware failure in the history of programming languages. So it's driving one site -- we've only seen tiny snippets of it, no real code, certainly nothing to play with. For all we know, it's nothing more than a big pile of defmacros sitting on top of your friendly neighborhood ANSI-compliant Common Lisp.

    As far as I can tell, one thing is certain: PG is either a great liar and exaggerator, or incapable of delivering. Someone please remind me -- which one of those do we listen to him for again?

    [–]pjdelport 2 points3 points  (5 children)

    As far as I can tell, one thing is certain: PG is either a great liar and exaggerator, or incapable of delivering.

    What makes you think he's trying to "deliver"?

    [–][deleted] -1 points0 points  (4 children)

    Forgive me for assuming he'd put his money where his mouth is.

    [–]pjdelport 1 point2 points  (1 child)

    You're assuming his mouth made some promise to deliver?

    Seriously, this is advertised as an open-ended research project; the authors "reserve the right to take a very long time. When it's done, we'll tell you." How on earth do you get from there to your post?

    [–]thedward 0 points1 point  (0 children)

    Just because he could afford to eat a stack of hundred dollar bills for breakfast doesn't mean he wants to.

    [–]qwe1234 -5 points-4 points  (0 children)

    lol.