9 ms·
Haskell vs. Ada vs. C++ vs. Awk vs (1994) [pdf]
- 0x54MUR41 10y agoPrevious submission on HN: https://news.ycombinator.com/item?id=13251855 https://news.ycombinator.com/item?id=13251855 a few days ago.
- deleted 10y ago[deleted]
- tibbetts 10y agoDisappointed that PDF wasn't one of the programming languages.
- cosinetau 10y agoIt would be great if that format were somehow Turing complete.
- nradov 10y agoWell you can run JavaScript inside a PDF, so technically it is Turing complete.
- hardwaresofton 10y agoFrom ~30s of searching, it looks like that's an Adobe Reader feature: https://stackoverflow.com/questions/9219807/using-javascript-inside-a-pdf https://stackoverflow.com/questions/9219807/using-javascript... My original comment was going to be "Who thought that was a good idea? Maybe there are reasons, but that sounds like a terrible idea at face value".
- NegativeLatency 10y agoI've seen some forms made with PDFs with js in them. A painful experience for sure.
- kccqzy 10y agoChrome's builtin PDF reader supports it. You can even find a PDF that uses JS to play a game of pong in Chrome.
- therein 10y agoWell, out of all the places that makes sense, it's Chrome after all. Either way, it sounds like a pretty bad idea to add this as a feature to Adobe Reader or somehow to the PDF spec. Especially since PDF remote code execution exploits happen relatively often.
- mhd 10y agoThat would be PostScript, of which PDF is pretty much the "compiled bytecode" version. I consider its abandonment a big loss for the industry. We could've gone PS++, but now we've got SGML++--++^&^!!1!!
- zurn 10y agoPDF viewers have lots of remote code execution vulnerabilities, so it is de facto Turing complete.
- 58028641 10y agoAfter learning Haskell, I found its approach to solving problems much simpler. I will admit that it was very unusual at first. Lens, monads, template Haskell, and a very powerful types system are the key features that make it standout.
- acchow 10y agoIMO, if you just use C++ without subtyping (no inheritance) and only immutable structures, you get most of the "simplicity" of Haskell. And with C++17 variant, you also almost get pattern matching. (also, as per "powerful type system", you can do dependent types in C++)
- wyager 10y ago> if you just use C++ ... and only immutable structures, you get most of the "simplicity" of Haskell. Huh? I cannot relate to this statement at all. C++'s memory model is not friendly for immutable structures. The semantics of C++ are also substantially more complicated than those of Haskell. Although Haskell has some fairly powerful type-level machinery (if you choose to use it, which you needn't), the value-level semantics are extremely simple across the board. Essentially everything in the entire language is just straightforward syntactic sugar over lambda abstraction/application and constructor application/matching. It gets more complicated (like C++) for high-performance library authors who need to peek under the hood at low-level memory operations, but 99% of users are insulated from that.
- eklavya 10y agoEither that statement is incorrect or I am misunderstanding one of C++ or Haskell very wildly.
- PeCaN 10y agoIf you just use C++ without $SOMETHING and $OTHER_THING, you get most of the $APPEAL of $LANGUAGE.
- lmm 10y agoSimplicity can never happen without enforcement. If there is no way to automatically enforce the use of this simple subset of C++ then it's impossible to use it on a real project where you have more than 1 developer. A lot of people seem to think it's a trivial, handwavable exercise to come up with this subset - but no-one has ever managed to actually do it. http://robert.ocallahan.org/2016/06/safe-c-subset-is-vapourware.html http://robert.ocallahan.org/2016/06/safe-c-subset-is-vapourw...
- saosebastiao 10y agoIt's old. It's so old, it predates Haskell's monads as an idea, let alone a solution to the IO problem. It was before Higher Kinded Types and GADTs. Linked Lists were still the primary data structure for everything. Haskell was more like Miranda than it was like Haskell today. Not only that, but it excluded some of the more prominent languages for prototyping of the time: Smalltalk, SML, Eiffel, and Objective C. And if you were to do it today, you'd invariably have to include languages that have had 20 years to catch up. Would the same result hold in a world with Scala, Ocaml, F#, Idris, Agda, Swift, and Rust? Let's face it, this study was a victory for higher order functions and ADTs with pattern matching. Let's not pretend it was anything more than that.
- the_af 10y ago> Let's face it, this study was a victory for higher order functions and ADTs with pattern matching. Let's not pretend it was anything more than that. In what sense was this not a victory for Haskell at the time the paper was written? You can always decompose any programming language L into a collection of X, Y, Z features and claim it's really about X, Y, Z instead of L, but is that a meaningful distinction? I love this paper because it explores the idea that functional languages with static typing can actually be very good at rapid prototyping. This goes against some oft-repeated "common sense" notion that "static typing is good for large systems, but for prototyping it's best to use dynamic typing". It's very illuminating that the two Haskell teams were the only ones that delivered [1] working, feature-complete code, and at the same time they had the fewer lines of code. [1] ...which would have mattered more if the examiners had actually looked at working code, the results hadn't been self-reported by each team, and the requirements themselves hadn't been determined more or less by each team. Seriously, if there is ONE complain to make is that the study wasn't rigorous enough. I'd love for this experiment to be conducted again with modern languages and a more rigorous methodology.
- berkut 10y ago> "It's very illuminating that the two Haskell teams were the only ones that delivered [1] working, feature-complete code" Where are you seeing that the Haskell code was the only "working, feature-complete" code?
- otabdeveloper 10y ago> 1994 Probably not relevant anymore.
- jonathonf 10y ago"Those who forget the lessons of the past..."
- crystalPalace 10y agoI really want to see the AWK geo-server implementation. I also want to know who the expert AWK programmer was. AWK is cool, don't get me wrong, but I don't typically think of it as a general purpose programming language.
- moftz 10y agoIt seemed like one of "I did it because I could" kind of projects. I've used awk to setup some complicated reformatting of text files that I needed cron but I've never even considered using it as a prototyping language. I wonder what kind of ADTs you can build using it and how viable it would be as the backend of a simpler scripting language.
- mpweiher 10y agoThis is a long time ago, but I remember coming across this competition when studying software architecture for my Diplomarbeit. IIRC, the Haskell solutions were disqualified, and actually for good reasons. The competition was about architecture of the system, with the geoserver an example component. Notice that for example Rapide is an Architecture Description Language (ADL). As far as I can tell, the Haskell team(s) only concerned themselves with the (purposely) simplistic/simplified functionality of the geoserver component, and not the architectural concerns that were the actual point of the competition. Which, quite frankly, is something I see frequently from the FP community: declare that <complicated actual problem> is really <much simpler problem easily solved by FP>, solve the simpler problem that ignores almost all the real requirements, declare victory and go home.
- wyager 10y agoWhat you are saying sounds interesting but very vague. Do you have any more details? Nothing you are saying corresponds to the contents of the PDF, which seems like a fairy complete summary of the competition.
- mpweiher 10y ago> What you are saying sounds interesting but very vague. Yes, it is vague. This was 20 years ago. > Do you have any more details? If you read the text carefully, and strip it of the "we were so awesome and those idiots didn't understand just how awesome we were" you can actually see quite a bit of what I was saying in the text itself. For example: "... neither [of the authors] attended the kickoff meeting at NSWC". So it's not entirely surprising if (as I suggest), they weren't fully aware of the actual purpose [especially if, as the other paper suggests, there were relevant discussions that preceded the kickoff meeting]. Or the following: 'One observer described the solution as “cute but not extensible” (para-phrasing); this comment slipped its way into an initial draft of the final report, which described the Haskell prototype as being “too cute for its own good”' Again, the authors frame this as the judges not understanding how wonderful their solution was, i.e. "everybody else is an idiot". Well, maybe everyone else isn't an idiot, and maybe the evaluation had something to do with not really contributing to the actual software-architectural purpose, which in turn had something to do with the authors not being there for the kickoff meeting? Of course, I wasn't there either, but this sure is what it looks like to me. Here is another paper, which talks more about the original problem and purpose of the competition, which was to be a sample problem (with sample solutions) for software architecture: http://www.cs.cmu.edu/afs/cs/project/able/ftp/aegis-iwssd8/aegis-iwssd8.pdf http://www.cs.cmu.edu/afs/cs/project/able/ftp/aegis-iwssd8/a... I remember seeing a more comprehensive report, which also had larger code samples and talked about the disqualifications, but I can't seem to find it right now.
- rekado 10y agoSpeaking of Haskell, Yale, and the 1990s: I ported the 1993 release of Yale Haskell to run on top of GNU CLISP. It only required a couple of small changes. The code is here: http://git.elephly.net/software/yale-haskell.git http://git.elephly.net/software/yale-haskell.git
- qwertyuiop924 10y agoThis was 1994. Why did they pick AWK as an example language? Perl was already fairly mature at that point. I happen to love AWK, but this is absolutely the wrong usecase for it: AWK is a highly domain-specific language, and using it here just makes scripting languages look worse than they are (and in the early 90s, scripting languages weren't that great).