7 ms·
Anic: Faster than C, safer than Java, simpler than *sh
- tlammens 17y agoThey forgot readability.
- aaronblohowiak 17y agoI disagree. The language is readable, if not intuitive. Once you read the tutorial, the examples all make sense. The intial example given is like a minified version of the code, and is probably not a good first impression.
- tlammens 17y agoI imagine myself having to read a couple of programs written in this language. It looks cluttered. Which doesn't mean I think the concepts of the language are bad. It now just looks like an explosion of \,],['s.
- aaronblohowiak 17y agoCompared to ruby/python, sure. Compared to c/c++/erlang eh, not so much.
- labria 17y agoErlang becomes easily readable once you wrote a few dozen lines yourself.
- jhickner 17y agoI thought so at first as well, but if you go through the tutorial, the syntax actually begins to look quite elegant. It just comes off as odd at first because it's dealing with concepts that are actually pretty unique (to my knowledge at least) - streams and latches.
- aaronblohowiak 17y agoAgreed. There's a lot of semantics in that there syntax ;)
- yesimahuman 17y agoAnd backslashes are among the characters I enjoy typing the least. But other than that I think it looks very interesting.
- barrkel 17y agoI wonder if this isn't just down to keyboard layouts. US keyboards have an extra-big left shift, and a small return key, with the backslash and pipe above the return. UK (and as far as I'm aware, most other Eurpopean) keyboards have a small left shift with the backslash and pipe key just to the left of the Z. The return key is nice and big, hard to miss. The button above the return is the backspace, also nice and big and hard to miss. (And annoyingly, every single Linux installation I have ever used has mis-mapped the Dvorak translation of the key to the left of the Z, mapping it to < and >, rather than \ and |. I often have to faff about with loadkeys layouts and xmodmap layouts for several hours every time I do a new install.)
- Tuna-Fish 17y agoI just want to add that the guy who designed the Finnish (same as Swedish) keyboard layout obviously held a deep grudge against c programmers -- most non-letter symbols that you need are just awful to access. Backslash is [Alt Gr] amd [+].
- zokier 17y agoYes, the finnish/swedish keyboard layout is just horrible today, when most stuff is designed to be used with US keyboard. That's why I use modified* US-intl layout on my computer even if its bit confusing to use other computers. *added ä and ö keys, as they are needed in finnish.
- axod 17y agoI'm pretty sure it's a joke, like brainfuck, whitespace etc. If not, then god help us all.
- Confusion 17y agoIt's just the first example that is a terrible, terrible turn-off.
- swolchok 17y agoIs this a joke? The URL spells "panic".
- deleted 17y ago[deleted]
- pavelludiq 17y agoanic is the reference implementation compiler for the experimental, high-performance, statically-safe, fully implicitly parallel, object-oriented, general-purpose dataflow programming language ANI. I really hope its a joke.
- dkersten 17y agoWhy do you hope this is a joke?
- pavelludiq 17y agoThe description sounded too over the top, too many words. Kind of like "The peoples socialist democratic republic of ..." its a pattern that rings negative alarms.
- pavs 17y ago
- pudo 17y ago> ANI is an attempt to fuse the intuitive feel of shell scripting Am I the only one who still has to google most of 'sh's predicates and syntax?
- stingraycharles 17y agoThat's probably because most people only sporadically have to write shellscripts. If you had to write it every day, I bet you wouldn't have that problem. Having said that, I personally don't feel shellscripting is all that intuitive either.
- scott_s 17y agoAs soon as my shellscripts need control structures, I jump to a "real" language like Perl or Python.
- ash 17y agoHaven't used it much, but I find Fish shell control structures much more consistent that those in *sh: http://fishshell.org/ http://fishshell.org/
- wheels 17y agoIndeed -- that's where Perl still fits into my day-to-day toolbox. It's exactly in those 5-50-liners with a little logic that I want a language with an overabundance of syntactic shortcuts. Shell is the exact opposite of that.
- cabalamat 17y ago> That's probably because most people only sporadically have to write shellscripts. Does anyone have to write shellscripts? If I'm writing one and it has any degree of complexity at all -- i.e. has loops or subroutines -- I just write it in Python. The only part of bash I know is the subset I use interactively on the command line.
- andrewvc 17y ago
- aaronblohowiak 17y agoThis is pretty cool. The compiler figures out the order of execution and parallelization of your code for you, based on a dependency graph that is generated from the code. So, you simply describe the behavior of your data and every description is assumed parallel. Once you read the basic tutorial, the language is not hard to read.
- capablanca 17y agoLike VHDL
- dkersten 17y agoStandard dataflow stuff really. Still, I'm excited to see how this turns out.
- eru 17y ago> This is pretty cool. The compiler figures out the order of execution Yes, indeed. You might also like Haskell and Clean that also do this. > and parallelization of your code for you And may soon do that as well.
- tlack 17y agoThis is a brilliant concept. Finally something new worth being excited about.
- aaronblohowiak 17y agoGraph-based approaches to program flow control are pretty interesting. The connecting of things to each other in a stream-like fashion is similar to Chuck, which you might enjoy.
- tlack 17y agoThis is very interesting, thank you. Any others like this? I'll contribute something to you, in return: if you're interested in graph-based audio/visual programming, check out vvvv for Windows. It's like Processing, but visual (i.e., designed via UI), and very very fast. It was made by visual artists who actually use it to make big bucks, rather than computer science weenies.
- dkersten 17y agoTheres plenty of dataflow-type languages out there. One of the most interesting, IMHO, is Lustre, since it seems to be used heavily in the defence and aerospace industries, though its pretty tough to find any information about it (though there were quite a few code examples in a recent SIGPLAN publication). Besides that, you may find the languages listed here interesting: http://stackoverflow.com/questions/461796/dataflow-programming-languages/949771#949771 http://stackoverflow.com/questions/461796/dataflow-programmi... I've been playing around with dataflow concepts myself and personally see them as the way forward in programming, though I'm not quite sure yet how it would need to be done to catch on as a mainstream language. I think I'll play with anic for a bit and see what happens :)
- axman6 17y agoOnce they actually have a compiler you mean?
- almost 17y agoThe first example given is a perl-golf style obfuscated thingy. Does that strike anyone else as possibly the absolute worst thing you could possible do when showing someone a language for the first time and wanting to make a good impression? The next example is a little better, I still have no idea what it means but at least it looks like I possibly might once I've read the docs (which I will do now).
- almost 17y agoHaving read the tutorial it (the dining philosophers problem example) now looks quite elegant. I'm still a little unsure about exactly what latches do and when you're meant to use the -> operator though. A quick syntax summary would really help.
- nex3 17y agoBut that's not the first example. The first example is the clock, which the page says is "terse but complete", and which uses very few names longer than three letters and very little whitespace.
- almost 17y agoOh yes, that still looks like line noise and I still think it's about the worst possible first example I can imagine.
- jcapote 17y agoTotally agree here, they need to link the tutorial front and center. After that it all makes sense.
- scotty79 17y agoI can't wait to turn it into webapp framework.
- ramchip 17y agoQuite interesting concept, but I looked through the code repository and didn't find any code generation at all. Only a parser. I think it may be very "alpha".
- deleted 17y ago[deleted]
- axman6 17y agoAlpha implies that there's something that somewhat works. I wouldn't consider just parsing something as working, myself.
- ramchip 17y agoThat was the joke :)
- ultimus 17y agoTrue, it's not alpha yet. But a lot of the semantic processing is being put into the grammar since in ANI, once a program is grammatically sound, it's just left-to-right type validation and dumping out boilerplate assembly for the equivalent of a type-safe stack machine. So even as it stands, the compiler is doing a nearly complete job of rejecting invalid programs, which really is the bulk of the work in compiling ANI.
- drhowarddrfine 17y agoIs every language claiming to be faster than C now?
- gvb 17y agoYes, and most of them are written in C (OK, C++ for anic).
- dkersten 17y agoWhat does it matter what the compiler is written in? (Disclosure: I never checked if this compiles directly or if it uses C as an intermediary, if the latter, then Ok)
- gvb 17y agoIt doesn't matter, however the OP asked "Is every language claiming to be faster than C now?" which struck me as rather snarky. The trivial answer is "Yes", but that answer raises two non-trivial and more interesting questions 1) If the language is faster than C, why write the compiler in C rather than natively compiling it (the acid test of a C compiler is if it can compile itself). 2) What computer languages are used to write computer languages? I've created a "Ask HN" question for discussion http://news.ycombinator.com/item?id=1042398 http://news.ycombinator.com/item?id=1042398.
- dkersten 17y agoWell, once the anic compiler is complete, it would perhaps be a good idea to rewrite it in ANI itself and have it be self hosting, but to get to that stage, you have to write it in another language first. What language? Any at all - whatever you're most familiar in is probably a good choice (and probably why a lot of them are written in C).
- eru 17y agoI agree. Though your grandfather comment still confuses me. If you are implementing a language (for which you also have some say in its design) and your compiler is too slow, then I would start e.g. by investigating caching strategies instead of switching implementation languages.
- berlinbrown 17y agoFaster than C. That is a bold claim.
- eru 17y agoIt's not that much of a claim, if they implicit parallelization works well. Also some functional languages are getting very nice optimizations like deforrestions / fusions that make them really fast.
- dacav 17y agoGood point. Also how can you measure this speed when talking about C? First of all there's not only one single implementation of the compiler, and second thing for available architecture you may have different performances basing on the quality of the backend... I find that kind of claim pretty annoying.
- bmunro 17y agoAnd it doesn't actually do any code generation yet.
- axman6 17y agoOur compiler parses ANI soo much faster than GCC compiles whole programs, it makes GCC look pathetic!
- KirinDave 17y agoNot really so much. You just target an area where C is not very good and you can do it. For bulk threaded stuff using lots of I/O, Java can be "faster than C." For extremely distributed code, Erlang can be "faster than C." These claims leverage the fact that the fastest implementation in C is incredibly difficult to write. Usually we discard that difficulty when comparing languages, but as time goes on the costs of developing specific distributed, multi-threaded, and/or reliable systems in pure C becomes so outrageous that it stops making sense to ignore, so we start comparing against less correct implementations.
- Wiz 17y agoAt least it seems faster to learn and faster to code.
- Pistos2 17y agoI wonder why the author chose to use backslash instead of any other character. Backslash is used for escaping in nearly every other language.
- dkersten 17y agoAccording to the newly added FAQ: backslashes were chosen for a purely pragmatic reason; on virutally all keyboards, backslashes are very easy to type (requiring only a single keystroke). This is a handy property for backslashes to have because in ANI, you'll be typing them a lot!
- deleted 17y ago[deleted]
- eplanit 17y agoThe write-up reads like an advertisement for a weight-loss product.
- deleted 17y ago[deleted]
- axod 17y ago>> "Think of ANI as a way to write fast, statically-guaranteed safe, well-structured, and highly parallelized software without ever encountering memory management, threads, locks, semaphores, critical sections, race conditions, or deadlock." You can do that in pretty much any language if you decide to. I'm not seeing the point here, and the syntax is just horrible.
- bmunro 17y agoYou have to read the tutorial. It does a much better job of explaining the language. ANI seems to be quite an interesting language. I haven't looked at dataflow languages before, so this might be fairly standard.
- TomasSedovic 17y agoSomeone is definitely "high on their own supply". On the other hand, (having read the tutorial) it does seem to be interesting concept that could be helpful in some fields. Pitty it's so poorly marketed. I hope they change that after it becomes a usable product.
- dkersten 17y agoIts in the very early pre alpha stages right now, so I guess with a bit of work, it could be pitched better. Of course, the real barrier to using this for real projects would be library support.
- willhf 17y agoI want: Many more examples contrasted with the equivalent imperative code. Examples with elaborate data structures. Implementation overview (current & objectives). Benchmarks on a multicore.
- leif 17y agoI don't know about anyone else, but when the homepage screams "portable" and I still need to add header includes to get it to compile (and the tests fail even then), I get worried.
- ultimus 17y agoIt's portable in the sense portability concerns are at the forefront and the stable build will work with all of the major OSes; tests fail because it's simply not all implemented.