4 ms·
I have had the same problem with the challenge as the gp ever since I read it. I'm a bit perplexed at what exactly Paul's point was. So I write a templating mo
by DanielBMarkham 17y ago
I have had the same problem with the challenge as the gp ever since I read it. I'm a bit perplexed at what exactly Paul's point was.
So I write a templating module for OCaml that lets me beat or tie the Arc challenge. I compile it and never have to look at it again. It becomes part of my toolkit.
What do I have to do in order to win the challenge? Get my module accepted into some standard library? Why would what some language committee decides be important in terms of how expressive the language is?
It doesn't make sense to me. All it shows is that Paul controls Arc and has configured it to deliver small answers to questions that he finds important. I'm not sure it says anything about Arc or any other language for that matter. It might say something about functional versus imperative languages, but perhaps we already knew that?
- pg 17y agoI'm a bit perplexed at what exactly Paul's point was. What do I have to do in order to win the challenge? I think the source of your perplexity may be that you're misunderstanding who (or rather what) is being challenged. It's not a contest between people, but between languages. So you don't win it; a language does. The way a language wins is if you can write the program shorter using it plus some standard libraries. The definition of "standard" doesn't have to be exacting; anything short of a library written specifically to win this contest would be ok; so e.g. any library that existed prior to the challenge obviously would be.
- axod 17y agoThe distinction between 'program' 'language' 'library' 'framework' is just arbitrary though. Just another vote for 'I have no clue what the point of this is'. The challenge seems to be: * Write a library with helper functions. Like the Arc library. * Now you can write a short program that uses that library to do things. Obviously that's possible in any language, so I don't understand how this measures languages at all. The example in Arc: (defop said req (aform [onlink "click here" (pr "you said: " (arg _ "foo"))] (input "foo") (submit))) Well this is a concise way to sum up what you want to do, but that could just be rewritten in any language of your choice. Then the appropriate libraries written. For example, java: createForm("click here", new Response("you said %foo"), new InputElement("foo"), new SubmitElement()); I think there's more important things to compare in languages. speed, error handling, stability, memory management etc
- floodyberry 17y agoIt wasn't supposed to measure anything, it was supposed to impress you with how awesome Arc is.
- pg 17y agoHere's the critical distinction: you can use only whatever's already provided by the language+libraries you use. That's what I did. I didn't go back and add stuff to the Arc libraries to make the answer to the challenge shorter. I just used what was there already. This will be clear to anyone familiar with the source of HN; all the language features used in the Arc version of the challenge are used throughout news.arc.
- axod 17y agoHrmmmm. But I could just write 'arc' for Java, and the above example would fall out. The solution for arc doesn't have anything unique in it that you can't do in other languages just as concisely. So I don't think it says anything at all about the language, it just says how well you designed the interface to helper libraries. >> "all the language features used in the Arc version of the challenge are used throughout news.arc." I don't see any 'language features' in the solution for Arc. It's just functions and parameters. They're not language features, they're helper libraries. They may be well designed good libraries, but that's what they are. The language used is irrelevant. You could have written arc in BASIC and the solution would be the same. Maybe I just don't understand why arc is referred to as a 'language' rather than a framework/library, and why that distinction is important.
- pg 17y agoOne language feature that's used here is lexical closures. This would be hard to implement concisely in a language without them. If you wrote an Arc implementation in Java, then ran the program on top of that system, surely that would count as an instance of Arc winning the the challenge, not Java.
- axod 17y ago
- jrockway 17y agoBut isn't Arc a library written specifically to win this contest? A well-balanced "contest" would probably include a bunch of specifics (web, 3d, computation, ...) or stick to generic "programming" ("implement a self-balancing binary tree"). I see the Arc contest as more of something like, "take a look at what happens when you think about a problem space in depth and write a domain-specific language to make solving problems in that space really easy". The only downside of Arc is that other domains are not as easy to work in. If you design a DSL on top of an existing language, then you don't have that limitation, which is what's good about the Haskell implementation. If I need to write a parser for part of my web app, I can use another nice DSL for that. If I used Arc, I would not have that option.
- pg 17y agoNo, actually. The Arc libraries were written to make general-purpose web apps. I didn't propose the challenge till after the first version of Arc was released. And the way I chose the problem was to think of the simplest stateful web app I could. If this isn't the hello world of stateful web apps, what is? There's nothing about this problem that's biased towards Arc's strengths. Take input from a form and print it on the next page. Every popular language already had libraries for such basic things. I suppose Arc was designed to win this contest in the sense that Arc is designed to make programs short, and winning in this contest is measured by brevity. Is that what you meant?
- jrockway 17y agoIs that what you meant? Not really. If I added a condition to the contest that you didn't take into account when writing Arc, Arc would no longer do as well. When the same person designs the programming language and the contest to "prove" it's the best, the contest is likely to prove that his programming language is the best. Not due to malice, but rather because both the language designer and contest designer think exactly the same way (as they are both the same person).
- pg 17y agoWhen the same person designs the programming language and the contest to "prove" it's the best, the contest is likely to prove that his programming language is the best. Ok. Now let's explore (or rather, return to) the question of whether that happened in this case. Since I was aware people would make this type of criticism when I proposed the challenge, I made a conscious effort to make the problem very generic-- in fact to be the simplest stateful web app I could think of. In your opinion, did I succeed? Is it a simple, generic problem to ask for input on one page and display it on the next? Or is this a complex problem that requires unusual, Arc-specific functionality to solve?
- DougBTX 17y ago> Get my module accepted into some standard library? Yes, that is the gist of it. More specifically, the challenge is, "at this point in time, has anyone gotten the appropriate code into a standard library?" As far as the challenge is concerned, we have to take it on faith that when the challenge was posed, it was no more than a coincidence that pg's language supported an example written in a style pg likes.
- DanielBMarkham 17y agoI think I'm getting this. Let me try another bit of questioning to make sure I got it. So let's say I think CSV-file processing is important. If I show doing something useful and common with CSV files in 15-20 symbols with my language of choice would it be fair to challenge other languages to do the same? If I understand you correctly, this all hinges around what libraries you think languages should have by default and how many symbols it takes to get something "common" done using these commonly-available pieces. This is a little too subjective for me, although I'll easily grant that web programming is much more common than CSV-file processing. Instead of relying on the arbitrariness of what components have been built or what various committees have approved, I would amend this to be something like "after an initial bit of programming not to exceed 3 days, how much symbology do I have to piece together to solve various problems in some sort of common domain like web question/response?" Or something like that. Because as a practical matter I'm always taking a bit to ramp up on new pieces of languages anyway and 3 days or so in this context is a nit.
- DougBTX 17y agoYes, that's how I understand the challenge. And I agree, it is subjective[1]. I think that the most positive way of looking at it is to declare that session storage in a web app and parsing csv files are understood problems which we don't want to get bogged down solving again. Last week I was writing a small web app to browse a 2GB or so data set, which was provided to me variously in xml and csv data files in a zip file. If I could have called: import data_20091201.zip and gotten something useful, I would be all the happier. I can now make that call, but in terms of getting stuff done, I'm judging my programming environment on the availability unzip utilities, xml and csv parsing libraries and database tools. As far as the language itself is concerned, I want to be able to structure my code neatly without worrying about forgotten temp files if the import fails. I see the arc challenge as a proxy for making this sort of judgment, but it does come down to: "Do the people who maintain the language and contribute to its libraries worry about solving the sorts of problems that I would like to solve? And are they successful in making my life easier?" [1] Subjective in the sense that the problem to solve is one that you may or may not care about solving, or may prefer to solve in a way that happens to use more code to make different aspects more explicit.
- whyme 17y agoI agree. The distinction between having a standard library and extending it with a new one is a weak distinction. The only thing it says is that arc handled a specific common function out of the box. What about all the other batteries that are not included in arc vs. language x? If you need to do any one of a hundred normal things that languages do, arc would fall flat on its' face. Try connecting to a database being capable of fetching large result sets, try having robust integration points with a host of common facilities. True pipes, cross platform, concurrency models etc. etc. My point is that any number of languages could offer a dozen challenges that arc would fail, but pg could always add it to his library and declare it standard simply because he's is in control as the authoritative source.