Anic -- Faster than C, Safer than Java, Simpler than *sh (code.google.com)
ANI is a dataflow programming language, with strong typing, implicit parallelism, oop and the beggining of an implementation.
"Q: How does ANI resolve the fundamental issue of deadlock in parallel programming? How does the Dining Philosophers example on the main page work?
A: In ANI, under the hood, pipes implicitly enforce total resource orderings for acquiring data. Somewhat surprisingly, deadlock theory guarantees that there will be no deadlock if this condition is met."
95 comments
[ 2.7 ms ] story [ 154 ms ] thread"Q: How does ANI resolve the fundamental issue of deadlock in parallel programming? How does the Dining Philosophers example on the main page work?
A: In ANI, under the hood, pipes implicitly enforce total resource orderings for acquiring data. Somewhat surprisingly, deadlock theory guarantees that there will be no deadlock if this condition is met."
That said, I really like the ideas this language is offering and I'm definitely interested in giving it at try.
ADD 1 TO COBOL GIVING COBOL
is also readable, and yet (thankfully!) we've mostly abandoned COBOL.
And no, I'm not saying Python is bad, or like COBOL - just that readability and quality of a language are not necessarily related.
(Yes, I just spent the last 10 minutes reading the COBOL pages on Wikipedia and Wikibooks.)
ADD 1 TO X GIVING Y is COBOL's way of saying y=x+1 ADD 1 TO COBOL GIVING COBOL is COBOL=COBOL+1. Or COBOL++ :)
Python is readable because its syntax is very close to many people's version of pseudocode. This is why non-Python programmers find it easy to read.
Or at least that is what Python developers seem to believe
I'd agree that programming languages do have various levels of "readability", and that Python is better than quite a few...
However I think the poster has a point.
Someone familiar to programming concepts and new to Python could probably read that...but so could they read the equivalent statement in most languages.
Someone completely new, and reading only that statement?
I'm not convinced....
It seems obvious to you because you know it already.
As a newbie, I could see that as assigning an entire list to animal and then printing it...or even other things. I wouldn't be sure what the : was about
Additionally I think a similar for loop in any language will be basically just as readable to a complete newbie...in fact some may find a c-style for loop more readable.
For example, do you really think a newbie will understand this:
Sure, it's pretty easy to understand once explained ...but so are most languages. It's obviously more readable than a Perl one-liner, and Python has properties that cause it to generally be more readable than many other languages....but I think the point about programming languages overall being "not so readable" stands.This makes sense though, as generally what people seem to mean by "readable" is "looks like English/forms a narrative"...and those often don't fit with what a computer program is (though sometimes they do).
Much of the language doesn't use the shift-key, especially in the number-row. And where it does, it's frequently on easier-to-hit keys like '<' or '{'. There are still parenthesis, but they appear to be used far less frequently than, say, C.
Besides. You want ugly? Try K: http://en.wikipedia.org/wiki/K_(programming_language) . Or, heck, anything APL influenced.
Plus, since all actions are based on arrays, the compiler can very easily target vector processors (including SSE) and make cache-effecient memory allocations. And since the language is small, the interpreter is usually small enough to fit in L1 cache.
Can't be.
Granted, tasks which have a natural sequence can be a lot more difficult in dataflow-driven languages, so use whatever works for a given situation.
ANIC was posted to HN most of a year ago: http://news.ycombinator.com/item?id=1042122 with much commentary.
Furthermore, there's tons and tons of parallel C code. Probably more than any other language. Almost any decent C library is reentrant. Many of major C projects (mostly thinking of server software and operating system kernels) are threaded.
That there's "tons and tons of parallel C code" doesn't matter.
Parallelization is built-in into this language. It is not built-in, as a first class language feature, in C.
A lot of C projects, such as servers, are indeed threaded, but threads are also so last century.
Different paradigms (like in Erlang) are better to parallelize, easier to write, more performant, and much much less confusing to debug than threads. Heck, even no-side-effects functional language programming is better to parallelize than C with threads.
in terms of South Park it is a Chewbacca argument. Another example of it would be - "C is smarter than Python because most of programs in C is smarter than ones in Python." (C and Python choosen randomly as i have no idea about Python :)
Looks like it's well written, planned and engineered tho.
1) Get rid of the infix modifier to the filter. The statement is made that in ANI everything flows left to right. The infix operator while providing familiar 1+6->7 notation conflicts with the above flow statement. 1,6+->7 while not immediately familiar is easy to understand after explained. However, added special case rules for infix operation muddies the water.
2) In the following code sample provided, the left to right rule is again not followed and thus leads to increased difficulty in [human] parsing:
multiPrint= [string\ s, int\ times] {
};"Hello, World!\n", 10 ->multiPrint;
Instead, to be consistent and follow the previous left to right flow rule, use the following syntax:
multiPrint= [string\ s, int\ times] {
};"Hello, World!\n", 10 ->multiPrint;
In general if there is an everything flows left to right rule, there should not be a <- operator.
imho
Interesting, but not necessarily useful. And looking how hard it is to "write" good vhdl logic, I'm not sure how many could handle coding in ANI.
Why do I think this? Because visual dataflow languages have been very successful as programming tools for non-programmers in niche areas. Eg, in music production: Puredata, MAX/MSP, Syntmaker, Reaktor; in 3D modeling (at least Blender has a dataflow-esque language for describing the render passes, but I've seen other visualization/graphics programs use datalow-like visual programming languages); in game development tools (I've seen at least three commercial engines which use some form of dataflow-esque visual programming language for describing shaders, AI and probably other things); the scientific community has LabVIEW. I'm sure theres others too (not exactly non-programmers, but the defense/aerospace industries have SCADE).
Of course, coming up with an intuitive, yet sophisticated enough to do real programs in, visual representation and GUI interface would still be a difficult task and I certainly agree that for a textual programming langauge, your comment is probably correct.
c := make(chan int, 2);
c <- 1;//c contains 1
c <- 2;// c contains 1 followed by 2
y <- c;//y=1
It's a blurry question regarding where you say a VM/Compatibility shim means that you no longer running the application natively. The same can be asked of Java, Flash, and a lot of interrupted/bytecode languages. The distinction to me in this case is that the code is meant to be compiled to native code (which it isn't in this case), and Cygwin is not a common platform available on a Windows system.
[Edit:] The asker of parent question should not be down voted, it is a reasonable question, and as I've stated it's open to interruption.
Distributing even a simple unmodified GPL library with your code is a huge PITA. Your app may not become GPL'd, but you still need to distribute a copy of the GPL with all its attendant "paperwork" and 3 year ftp servers and original sources, yada yada.
Pretty embarrassing for HN to be so reliably trolled.
For example, why not compile or manually translate some examples to C as a prototype? What can be done in assembly can mostly be done in C as well, if you're willing to sacrifice some performance.
As for proof of concepts, on the mailing list he has stated that ANI is more or less a natural progression from previous unreleased projects.
Having said that, I agree that focusing on getting something working before trying to make it fast is the correct way to do it...
But: when it says, "ANI is designed to abstract away from the idea of an "algorithm" altogether," I go, "quackery."
The developer needs two things: (a) financial support so he can work on it full time, and (b) an active community of contributors. Maybe some organization could sponsor him, or perhaps do a Kickstarter fundraise or simply ask around for donations... I just hope it gets some traction and a compiler; for certain problems Anic could be a very interesting and natural approach.
PS: The first response in this thread contains a few well articulated reasons for being interested in Anic: http://groups.google.com/group/ani-compiler/browse_thread/th...
Sadly its much worse than that.
Only one of those 3 committers, Adrian/Ultimus, is actually actively committing. I know this because I'm one of those three committers - I was given commit access because I helped answer questions and edit the wiki pages a little (because I knew enough about dataflow languages prior to encountering ANI that I was quickly able to understand the concepts and code). But I have yet to actually commit any code.
I was working on a simple x86 code generator (basically walk the AST, using maximal munch instruction tiling), but its not near working and I've been horribly busy with paying projects to finish it :(
At best it's written like a oral lecture, at worst it's wordy, condescending, overuses of italics for emphasis, leads by the nose for no apparent reason, and has obvious exaggerations that aren't clarified.
The grammar is all fine and so is the general structure, but I suspect a good writer could help a lot with the remaining details.
Building main executable... src/types.cpp: In member function 'TypeStatus::operator uintptr_t() const': src/types.cpp:1514: error: cast from 'Type*' to 'unsigned int' loses precision
I can believe it - I've made my own language and compiler whose results are faster in the niche area it targets than any C compiler I've ever seen - I'm just curious how this assertion is backed up.
"Faster than C" is doable, but needs qualifiers, e.g:
CUDA in modern GPU hardware is faster than dektop C.
JITed Java was shown to be faster than C in several cases, because the JIT compiler could make adaptable optimizations based on the actual runtime environment.
And, any competent language that takes advantage of multiple cores easily is faster than most C equivalent programs (even most multi-threaded ones).