Dao, a New Programming Language Supporting Advanced Features With Small Runtime
New submitter NeoHermit writes "This language (Dao) has never been mentioned on Slashdot before, but it might be interesting to many people here. As it has recently become feature-complete and just made its first beta release, it may be the right time to mention it here. Dao is an optionally-typed programming language that supports many advanced features with a small runtime. The feature list is probably as long as that of Python, but they are supported by a much smaller runtime (somewhere between Lua and Python, but closer to Lua). Besides optional typing, the other major features that worth mentioning include: built-in support for concurrent programming for multicore computers, very friendly C programming interfaces for embedding and extending, a LLVM-based JIT compiler, a Clang-based module for embedding C/C++ codes in Dao, and a Clang-based tool for automatic binding generation from C/C++ header files. You can also see many familiar features from other languages."
It's basically Go with fewer features, next!
Monstar L
Have fun designing programs that manipulate massive amounts of state with functional programming style. Given that nobody has figured out how to do a first person shooter with a functional langauge, makes me suspect that they aren't the one answer to every problem. In fact even a relatively simple game is quite awkward in a functional style.
I guess you can't solve every problem with lambda calculus and retain your sanity.
Someone better go dig Strousoup out because he ain't dead, yet.
So if Dao is optionally typed, what are the other programming input options? Voice input? Graphical point n click input?
Tail-recursion: yes; Lazy evaluation: no. It does support some functional programming styles, at least as much as python or ruby supports. It's just that it is not branded that way. But if you are looking for a programming language that supports functional programming as its major programming paradigm, this is not the language you want. But certainly this is not the reason to dismiss it as failure.
Someone better go dig Strousoup out because he ain't dead, yet.
Ack, I meant Dennis Ritchie, the inventor of the C programming language, not Stroustrup, who invented C++. My bad...
#fuckbeta #iamslashdot #dicemustdie
"Yet Another Pissant Programming language". Can we quit pretending that "new is better" and just use the stuff that actually works?
Sttroustrup ( you know youm could have gotten the name right )
You sure you wanna be correcting folks?
Way to fight the chauvanistic stereotype of girl geeks as dilettantes.
I fail to see how making an educated assessment of the value of a new programming language meets the definition of a dilettante. I know of many geek girls (yes, girl comes second, we are geeks first and foremost -- pay attention Anonymous Coward, there will be a test) who know nothing of programming yet nobody would question their overall geekiness. Perhaps you're unaware that there's more than one kind of geek? I have one friend who's an art geek. She spends her days painting, sketching, and is a consumate book worm. I enjoy her company and her passion quite a bit. She has about as much computer sense though as a door mat and I have to fix or reimage her system on a seasonal basis. I don't begrudge her not knowing computers though; Not everyone can be a computer geek.
#fuckbeta #iamslashdot #dicemustdie
The Dao that is feature-complete is not the true Dao.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
I've looked at a lot of code over the years that pushes the actual work to be done around like a two-year-old pushes peas around a plate. I've gotten to the point where I can read the mind of the programmer through the code he's written. He's thinking "If I push this over here maybe it will magically go away and I won't have to deal with it." Most of the time this is because he doesn't actually understand the business logic behind the code he's writing. He's writing to a series of requirements but he has no understanding of why the requirements exist or how they drive the business. So he tries to keep his code abstract as possible and hopes that no one notices.
Sadly no one has yet written a language that forces you to actually understand the problem domain that you're coding. I'm sure it wouldn't be very popular if anyone ever did. Neither has anyone actually managed to write a language that allows you to write useful code without understanding the problem domain, and no one ever will. Now if someone could write a language that a non-programmer who understands why he needs code written to describe what needs to be done directly to the computer, that might fundamentally change my job description. Given that most of those people obviously can't even express this to another human being (Judging from their requirements docs,) I'm not losing any sleep over it.
What the people who flit from language to language or framework to framework like bees are looking for is a tool that allows them to write code without understanding a problem. Someone who actually understands the problem will always outperform them in any given language. In other words, just because your language has an expressive syntax or any specific feature doesn't mean you can hire chimpanzees to code your application.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
In programming language parlance, "runtime" refers to the implementation of the virtual machine. In compiled C, there's very little "virtual machine"; basically it's just startup and shutdown.
The standard library is not the runtime. Indeed, many programs (e.g. OS kernels, firmware) don't bother with a standard library, though they also typically implement a custom runtime.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
"concurrent programming" to me could even mean using two keyboards.
Best misdefinition ever.
"First they came for the slanderers and i said nothing."
Strousoup doesn't exists, Stroustrup is still alive.
"Optionally-typed" does not exclude type casting.
Compiled languages have runtimes too.
I think with "concurrent programming" they mean the widly accepted term "concurrent programming" http://en.wikipedia.org/wiki/Concurrent_programming
Most popular programming languages have a C programming interfaces, including the ones you'd probably call "complete".
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
Maybe.
Strict typing a la Algol requires you to write more code (in the form of type declarations). Strict typic a la ML requires someone to write more compiler, which isn't a problem if you're shipping compiled code, but in a typical scripting scenario it requires there to be more compiler in your runtime and (more importantly) slows load time.
Dynamic/optional typing requires you to write more tests (unless you want less robust code, of course), but tests typically don't impose a cost at run-time. If you only need a thin layer of scripting glue, then the tradeoff may be acceptable.
I agree that it's not "highly desirable" as a general rule, but I can see the use case.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
That's called "agile".
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
Dao is an optionally-typed programming language
ARRRRGH! Comeon guys, type casting is so important even answers.com has a bloody writeup on it. Strousoup is right now spinning in his grave so furiously I'm sure it's causing a small earthquake right now on some pacific island...
Do you really know what is optional typing (and type inference)? Otherwise you wouldn't be using the tiny example in that link as an argument against optional typing.
that supports many advanced features with a small runtime.
Runtime? So it's like Java then... it's interpreted. Ooookay, well, I suppose runtime languages have their place amongst the honored...
As others already pointed it out, runtime is not just for interpreted language.
The feature list is probably as long as that of Python
And already we have our first example of why type casting is important: The programmer/submitter here isn't sure what the feature list of the language is, because everything is represented as an abstract object. /snark
I don't see your logic here.
Built-in support for concurrent programming for multicore computers,
I'm not entirely sure what that even means. Does it support threading? Is it stackless? Are you talking about the ability to set processor affinity for a given thread or process? "concurrent programming" to me could even mean using two keyboards.
Seriously, what do you expect? "set processor affinity for a given thread or process"??? Maybe "on" is a better preposition than "for" here, but anyone know about concurrent programming should understand what it really means immediately regardless the preposition.
very friendly C programming interfaces for embedding and extending, a LLVM-based JIT compiler, a Clang-based module for embedding C/C++ codes in Dao, and a Clang-based tool for automatic binding generation from C/C++ header files.
So basically, your language is incomplete so you're giving people the ability to link in stuff to makeup for it. Okay, that's cool... I guess.
So in your opinion, any language that has interface to C or another language is incomplete. Do you also think any language that has external libraries is also incomplete?
It's understandable that people like to bash new languages, but if you do, please make some more solid points.
It seems that way because on a typical platform the C virtual machine is a very thin layer on top of the operating system and CPU. Its implementation is almost all initialisation and shutdown, and even then there's usually very little to do.
If you don't believe me, I suggest you try it. Even if you don't use the standard entry point (avoiding the need to process argc/argc/envp) or exit point (avoiding the need for atexit), at the very least you'll need to set up a stack before you transfer control to C code for the first time. That is initialising a virtual machine.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
Okay, so here is my uninformed opinion and some free unsolicited advice ;-)
First of all, some people here are just too defeatist. Yes, it looks a lot like Go and has only few exceptional features, but it's certainly not the worst programming language I've ever seen and e.g. seems to be overall better than Python - if we ignore, for the time being, the external library support which makes Python so great. I agree with others that optional typing is a bad idea, though. Many optimizations will be hard to implement in future and loose typing should be explicit (as e.g. in polymorphic types).
Since I'm sort of a hobby programming language enthusiast, working on my own toy language in my spare time, there is one annoying thing I must mention, though. Why do so many contemporary language designers choose C-style syntax and not Algol/Pascal/Ada style? Just because they know C best? All of these C-clones, each of them with their own little quirks and specialities, don't really make the syntax more compelling or easier to read. (It would be okay if they behaved exactly like C, I guess, but then they wouldn't be languages on their own.) Why not go for block-style syntax or the Python wite space route instead?
Take a look at Ada, for example. Yes, I know, the syntax is verbose and has to many double-uses of keywords. It is a bit archaic. However, on the bright side, Ada programs really are extremely readable. You can easily scan through GNAT's source code and understand how the packages work without looking at additional documentation! I'm not saying, "Hey, let's all switch to Algol-style syntax", and not everybody likes the way Python deals with white space either, but a little bit more variation would be nice.
Which brings me to another issue. If you invent a new language, please make sure twice already in the design phase that it can be optimized later. Nothing is more annoying than an overall nice language that also becomes popular, only to turn out to be basically unoptimizable later. If a function has no side effects, if a data structure is immutable, if instructions or data structure traversals can be executed in parallel, please give us a way to indicate that within the language unless it can be inferred automatically. At least in theory, a new programming language ought to be capable of being as fast as C[1], Fortran, or Ada. Otherwise you could just save yourself lots of trouble and translate it to C++ or SBCL right from the start...
Footnote [1]: To be taken with a grain of salt. Arguably, C is the the first in the list only because of extensive compiler optimizations not because of its language features.
You must be new here. Stackoverflow moderaton has a sort of friend-system going for it. Friends moderate eachother's posts up. The more popular posters regularly get upvoted for mindless nonsense and regurgitation of the obvious. You stumbled on a particularly popular poster. You probably won't even get a response from her/him, as she/he doesn't see an opportunity to get more upvotes from a response to you.
They found a way to gain the system, and they love it. That's why you see so many regular posters posting content with common themes and getting upvotes for them, meanwhile giving the rest of us a WTF-level through the roof.
Personally, I think they derive some sort of pleasure out of it because they have confirmation addiction. But yeah, we can't deny that downvotes make us feel sad, and that upvotes make us feel good in a very basic way. Me, I just come here to possibly get some good debate, and to vent.
ventually you have to know what kind of object you're holding and you actually to use it to do some real work.
I agree.
Fundementally all a computer does is manipulate data. The type of the data is the only thing that defines which maniuplations are possible and meaningful. If you aren't thinking about the types, then there is nothing you can do.
Of course, no one wants to be caught up in irritationg games to satisfy the compiler. This is why I really *really* like the look of concepts (and C++ templating which uses ad-hoc concepts).
Types become exactly defined by the semantics of their operations, i.e. if it's addable, it's a number. If it's dereferencable and incrementable, it's a pointer like thing, and so on.
SJW n. One who posts facts.
Dao is an optionally-typed programming language
By far the nicest "optional typing" I've seen is C++ concepts. The others I do not like. Af far as I see, a computer manipulates data and the type defines the semantics of maniuplation. Without types then there is no manipulation to even think about.
Concepts is the best thing I've seen for optional typing since it allows you to specify the required semantics instead of the concrete type, which is what you want. (type classes are somewhat similar)
The other ones just let you plug in any old crap and hope for the best
Runtime? So it's like Java then... it's interpreted.
I have not read TFA, but "runtime" doesn't necessarily imply interpreted.
For example even hosted [in the standardede meaning of the term] C programs have a runtime, which generally just consists of a bunch of entry points for stdlib functions, and of course the startup code which initialises main. The latter in fact resides in crt1.o (C Run Time.o).
Hosted C++ has (optionally) larger runtime requirements. As well as having a larger standard library (of course, since it subsumes the C one), it also needs vtables (if you have virtual functions), exception tables (if you use those) and RTTI names and stuff (if that's on).
Those are definitely part of the runtime, and the tricky thing about a C++ kernel it seems is making sure all that stuff is set up correctly before starting the full execution, since you can't rely on the OS to do it for you...
But yes, they have gon and implemented their own VM, so it is what one would generally consider "intrepreted". However, with LLVM's ability to interpret or bitcode, that distinction has almost gone now given that it's now much easier to do both.
So basically, your language is incomplete so you're giving people the ability to link in stuff to makeup for it. Okay, that's cool... I guess.
That's a little harsh. Even in a complete language, it's probably worth simply linking against a C library, rather than (for example) trying to reimplement things like libPNG or (much much worse) ffmpeg yourself.
That said, it's "just another language", and apart from a few "quite neat" bits, there is nothing substantially new that greatly increases efficiency or expressiveness or etc over existing languages.
SJW n. One who posts facts.
Not because it's a bad language. It may be great. The fact is that nobody... I mean *nobody* needs one more obscure little language whose wondrous new features would just be another add-in library in C++. This is a mental masturbation tool for the Mom's basement crowd. Nothing more.
Please do not read this sig. Thank you.
I don't know. All I remember from the expensive five-day training session is that you're supposed to sit at the same keyboard as someone else, and that you stop coding and genuflect when a Scrum Master enters the room.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
It's OOP as implemented by SmallTalk, where objects are meant to be thought of as computers that you send messages to, and they decide how to handle those messages. If an object responds to a message, then it's the correct type.
Not quite.
With concepts, the binding is much earlier. The way it's proposed that it will work is that you define (e.g.) a number concept, which encapuslates the idea that +,-,*,/ and perhaps exp and log are implemented.
You then write the code, and it checks the code against the concept: i.e. if you try to use a feature which is not in the concept, compilation will fail. Note that concepts-lite does not implement this part.
At instantiation time, the type is checked against the concept (i.e. does float have +,-,*,/,exp,log) and the compiler will only pass it if it does match. Concepts-lite does implement this part.
Note that with concepts-lite you get late compile-time binding, os you can still get errors if (for example) your algorithm then tries to use ^ which isn't defined for floats. That's more like the message passing version (though at compile time---which means at runtime for the template program), where errors happen if you try an invalid operation on an object.
With concepts, the checking happens earlier.
SJW n. One who posts facts.
Even if you're referring to a "freestanding" implementation of C without most of the standard library, the runtime still needs to clear uninitialized statically allocated variables to 0 (for numeric types) or (void *)0 (for pointer types) before calling main().