Dao, a New Programming Language Supporting Advanced Features With Small Runtime 404
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."
There's a reason nobody talks about it (Score:5, Funny)
Re: (Score:2)
Re: (Score:2)
Re:There's a reason nobody talks about it (Score:5, Interesting)
Dao (and Go) do not solve programming problems better than other mainstream alternative languages. Seriously, I looked through the list and asked myself what Dao could do that (say) C, C++, Java, Groovy, Scala, Clojure, or Haskell couldn't do, and I couldn't come up with anything.
If someone is really interested in solving programming problems using language design, I need a language that satisfies the following:
a) Object-oriented, when I want it. Not the C++ bullshit of multiple inheritance, but Java's OO model isn't bad as a start; maybe add Scala's mixins and traits as well to that.
b) Functional, when I want it. But not Scala-functional: more like Haskell or Clojure functional.
c) Strongly-typed, most of the time. When I'm solving specific domain problems, I want the type system to ensure I'm not jamming a Foo into a Bar.
d) Optionally- or non-typed, once in awhile. Sometimes I'm just writing an algorithm that should be able to deal with any sort of object and don't care what the underlying object is. Java's generics are ok, but sometimes they just get in the way.
e) Reasonable concurrency model - message passing, threads, actors, producers, consumers, event buses, etc.
f) Garbage-collected. I used to do malloc()/free() and new/delete, but I'd rather have the underlying language handle objects for me. (That isn't to say that I don't care about memory pressures - I'm ok with allocating objects once and tracking their state instead of allocate/release/garbage-collect thrashing.)
g) Proper closures and exception handling in the OO part. (Closures and monads should be part of the functional part of the language).
Note to Scala crazies: the above may LOOK like Scala, but it sure as hell isn't Scala. No one in their right mind would develop something that had to be maintained in Scala, because part (h) that I don't want is this: arbitrary operator definition and overloading. That right there makes Scala a total disaster. For an example of this, see the Lift examples.
Re: (Score:3, Insightful)
Lisp?
Re:There's a reason nobody talks about it (Score:5, Informative)
That's an assumption that hasn't been true since the 1950s. Common Lisp has full structures, OO classes & objects (and meta classes for defining the OO system itself and extending it), multimethod dispatch, complex & rational numbers, full Unicode strings, etc.
Re: (Score:3)
Re: (Score:2)
I suspect you might want O'Caml semantics with a more modern syntax.
Re: (Score:3, Informative)
Re: (Score:2)
You should look more in Groovy because that is basically the feature set of Groovy.
Re: (Score:2)
f) Garbage-collected. I used to do malloc()/free() and new/delete, but I'd rather have the underlying language handle objects for me.
What is this language of which you speak that requires new/delete use and does not manage memory for you. It sounds suspiciously like C++ circa 1995, but I can't see why anyone would be doing that in 2013.
BTW: C and C++ actually can work with a garbage collector, it's just that support is not built into the language. GCC, for instance was a very large C program using the Bohe
Re: (Score:3)
Items I think you're missing:
i) REPL for rapid exploration of language features.
j) If the language is compiled, fast compilation times. This to me is a massive reason to prefer Go and D [dlang.org] to C++ when you're building something that has to be near C++ for speed but does not need to hook deeply into existing C++ code.
I also disagree on your need for strong static typing. Let's say you have some kind of object with function
Re: (Score:2)
he should have added h) readability, I need to read it back to myself in 6 months time and understand it.
Re: (Score:2)
That is what comments are for.
Re:There's a reason nobody talks about it (Score:5, Insightful)
No it isn't.
Seriously I see stuff like this in legacy code all the time:
i--
Comments lie, code doesn't. Someone is going to update the code and not bother with the comments.
Re: (Score:2)
Comments lie, code doesn't. Someone is going to update the code and not bother with the comments.
True - there are many crap programmers around; but that is what things like code reviews should be for. If you find a programmer who does that sort of thing do you want to continue to employ him ?
Re:There's a reason nobody talks about it (Score:4, Insightful)
Absolutely but I don't get to review every line (although I certainly try because I often wonder WTF is being check in other people's code reviews) and I can't do much about the code that was written years ago that has been left to bitrot.
No, not really. But fucked if it's my choice or if I know where the hell the programmers are who don't do this stuff.
Re: (Score:2)
And comments can be true while code is completely wrong. I've found, far too often that developers who say "read the code" have written complete nonsense. If the code is at complete variance with the comments, then it's a helpful warning that _both_ are wrong.
Re: (Score:3)
Wouldn't it be better to write in a language where simple things DON'T need commenting?
Otherwise you're coding twice, once in Perl and once in English (probably).
Re: (Score:3)
No. We are not talking about the same thing. You are talking about line by line comments that say what actions the code is doing; in general someone competent in the language should be able to read/understand the actions[**]. The more important comments are about why the code is doing something, ie the purpose - you need comments like that in whatever language you use.
[**]: but there will sometimes be occasions where a complicated RegEx, or something, needs explaining.
Re: (Score:3)
he should have added h) readability, I need to read it back to myself in 6 months time and understand it.
Perl is only as (un)readable as you make it; if you write readable Perl code, you won't have any problems reading and understanding it 6 months later.
But yeah, you can write unreadable Perl code - but then again, is there any language in which you can't?
Re: (Score:2, Insightful)
Perl: the expressive power of gibberish combined with the readability of gibberish!
Seriously, you CAN write maintainable code in just about anything, but why would anyone want to write in a language which makes that so difficult?
Re: (Score:2)
You must be joking! Dao has almost all the major features that Go has...
Maybe this is a Whoosh! moment for me (it is late and I'm getting sleepy), but isn't your comment the same thing the OP said, just in another format? Yet you seem to be disagreeing with him?
Re: (Score:2)
NeXT wasn't a language, it was a computer. Objective-C was the language...
Do they have tail-recursion or lazy evaluation? (Score:2)
If not, then it is just another fail, as functional programming styles are not supported. From the web-page, it seems it is indeed just another failure.
If they had either, it would be a significant step in the right direction. Optional typing is definitely highly desirable.
end the lambda idolotry! (Score:2, Interesting)
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 [dadgum.com] in a functional style.
I guess you can't solve every problem with lambda calculus and retain your sanity.
Re: (Score:3)
There actually is a Haskell FPS [haskell.org]. State manipulation is a little awkward in some ways, in part because there isn't a universally agreed-on way to do it, but the tools are getting better. With lenses on top of a State monad, things start to look pretty similar to an imperative language, except that you get the benefits of functional programming as well (for instance, error handling is a lot easier when you don't have to back out a bunch of changes because you still have your original state lying around).
Re: (Score:3, Interesting)
Re:Do they have tail-recursion or lazy evaluation? (Score:5, Insightful)
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.
Re: (Score:3)
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 do
Re: (Score:2)
Two people who understand the problem, one with five tools in his belt, the other with one. The first guy is going to get the most return on his investment, the second guy will always have work.
Let's not waste time on the chimpanzees.
Re: (Score:3)
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 whi
Re: (Score:3)
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 conce
Optionally typed (Score:5, Funny)
So if Dao is optionally typed, what are the other programming input options? Voice input? Graphical point n click input?
Re: (Score:3)
Something like the OMG OCR Calculator [thedailywtf.com]?
Re: (Score:3)
That settles it, then. I don't want to use a language if it encourages JavaScript-style code.
Re: (Score:2)
Re: (Score:2)
Are you kidding? I'd love to write one-liners for a living!
Re: (Score:3)
Re:Optionally typed (Score:5, Funny)
Surely I'd die of insanity before my conscience kicked in. Besides, "bind shoggoth" requires an import.
Why? (Score:2)
Why would someone want to use this language instead of an established language? So there is a feature list. Is there something there that is compelling enough to leave an established language community?
A language alone has little value. It's the community / ecosystem that makes it worthwhile.
Re: (Score:2)
New languages are the proving ground for new programming language features and implementation technologies. Right now, Dao doesn't nee people to make it mainstream, it needs people to see how that feature set and implementation technology works in practice.
Re: (Score:2)
So what's so standout about the feature set and/or implementation technology? TFS and a quick read of the linked feature list doesn't make anything jump out at me.
Re: (Score:2)
I have no idea. I was speaking generally about why we need new languages even if they're never adopted for serious project.
Re: (Score:2)
Re: (Score:2)
I'm back from a trip on my time machine. I was in the 60's and I heard someone at Bell Labs arguing "why would someone want to use this C language instead of what we already have?" Don't worry, I didn't tell him what was about to happen.
On a less funny note, people experiment and throw languages at us. Java, JavaScript, Perl, Python, Ruby were not established 20 years ago. Actually only two of them already existed at that time. Countless other languages came and died but nobody was able to predict which one
Small runtime? (Score:2)
How about zero!
WTL is an open-source C++ framework for creating Windows applications that typically require no installation, no runtime whatsoever, and generally compile to an exe less than 100K in size!
Re: (Score:2)
Even C doesn't have a zero-sized runtime.
$ ls -l /usr/lib/crt1.o /usr/lib/crt1.o
-rw-r--r-- 1 root wheel 10104 22 Mar 17:44
Re: (Score:2)
You are, of course, correct. WTL, however, does not require any runtime library beyond what is included in the OS.
Re: (Score:2)
Wow, you mean the firmware program I wrote least week that went on bare metal had a runtime?
Try again.
Re: (Score:2)
Unless the CPU transferred control directly to C code at boot time, without passing through any lower-level initialisation first, then it had a runtime.
But even that is no guarantee. Some implementations of C provide enough support for low-level hackery that they allow you (or the vendor) to write the runtime in C itself, including setting up the stack pointer. I've certainly done that before. It's possible, but it's rare.
Re: (Score:2)
Yes, it did. Thats the way most firmware works. Even those projects with an embedded OS end up working like that, unless you want to redefine runtime to mean an OS itself.
Re: (Score:2)
Not every C program needs every part of the standard C runtime, but I'd wager that every C program in existence needs the stack (which is why I keep talking about it). So the key question you need to ask is: Who sets up the stack?
If it's the operating system (there are "linkable" operating systems, and operating systems which ), then the OS implements the runtime. If it's a piece of assembly code which then transfers control to C, then that is the runtime. If it's C code, then the runtime is (at least partl
Re: (Score:2)
Re: (Score:3)
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.
Re: (Score:2)
Re: (Score:2)
I'm pretty sure that's what I said in slightly different words.
Re: (Score:2)
Not every C program requires OS initialization. I've written firmware, OSes, DOS apps, and even unix apps that did nothing- just jumped straight into main. C does not have a runtime. You can add one in, but by language default there is none. Nor have I ever heard of anyone calling library initialization a runtime before- I don't think you understand the term.
Re: (Score:2)
Clearing BSS first (Score:3)
The YAPPing language is for dogs (Score:3)
"Yet Another Pissant Programming language". Can we quit pretending that "new is better" and just use the stuff that actually works?
Re: (Score:2)
Know why we have malware? Single Stack for code and data.
Wow, welcome to the new millennium where any sane OS/CPU supports the NX bit. It's been there for a while. Compile your code with gcc -z noexecstack , or rather, just don't turn the noexecstack option off. It's on by default. Your problem isn't a problem of programming languages, and it's been solved.
Also, you're making my sig really hard right now.
Re: (Score:2)
The name is to attract a certain type of Programmer.
It's pronounced
Duh... Ohhh?!?
Re: (Score:2)
Haskell's not on your list and came out in 1990, it's still hunky-dory, no? :-)
All I could think of ... (Score:2)
YAPL (Score:2)
Hmmm (Score:2)
Re: (Score:2)
dao used to be a common coding acronym for Data Access Object, viz a wrapper around sql.
(Then they came up with POJO)
optional typing? (Score:2)
Dao doesn't seem to have "optional typing", it seems to have a choice between static and dynamic typing.
Redundant summary is redundant (Score:2)
idea : # times it occurs
"Let's mention this on
"It's done" : 2
small runtime : 2
features : 3 (plus that laundry list of actual features)
Instead, let's try this:
"The Dao language has recently made its first beta release, and we think you Slashdotters will Eff'ing love it. Dao is an optionally-typed programming language that supports many advanced features (probably as many as Python ) with a small runtime
This is getting boring (Score:2)
My opinion and some free unsolicited advice ;-) (Score:5, Interesting)
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.
Re: (Score:2)
Because {..} takes a lot less typing than begin..end.
If people wanted to type excess verbiage, they'd stick with COBOL.
YABL (Score:2)
YABL. Come on, people, really?
Unsafe arrays.
Forced-indexing into arrays.
Not interested.
And may it die it's well deserved death... (Score:3)
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.
Re:you had me at... (Score:5, Funny)
Someone better go dig Strousoup out because he ain't dead, yet.
Re: (Score:3, Informative)
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...
Re: (Score:2)
While I don't disagree with your assessment of the language, FWIW, all languages have runtimes, not just interpreted languages.
Re:you had me at... (Score:5, Funny)
"concurrent programming" to me could even mean using two keyboards.
Best misdefinition ever.
Re:you had me at... (Score:5, Funny)
That's called "agile".
Re: (Score:3)
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.
Re:you had me at... (Score:4, Insightful)
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 [wikipedia.org]
Most popular programming languages have a C programming interfaces, including the ones you'd probably call "complete".
Re: (Score:3, Interesting)
Dao is an optionally-typed programming language
ARRRRGH! Comeon guys, type casting is so important even answers.com [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 prep
Re: (Score:2)
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 post
Re:you had me at... (Score:3)
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
Re:you had me at... (Score:5, Funny)
Sttroustrup ( you know youm could have gotten the name right )
You sure you wanna be correcting folks?
Re: (Score:2)
Well, this will kill him.
If everyone misspelling his name hasn't done so already.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
I swear I'm notâ"this is entirely about how to spell Stirstrap at this point. really, denmark, what were you thinking
This being Denmark, they probably named him as such so nobody could find him on the internet, thus fulfilling the secret dream of every Danish person: To not be noticed. :D
Re: (Score:2)
After all, it worked so well for Lars Ulrich.
Re: (Score:2)
After all, it worked so well for Lars Ulrich.
Unfortunately, even being Danish isn't enough to conceal such a concentrated amount of asshattery.
Re: (Score:3, Interesting)
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
Re: (Score:2)
I always thought this was a NERD hangout!
Now we got GEEKS on our lawn!
Wai...Wha... girls too! /. != Stagparty
Re:you had me at... (Score:5, Informative)
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.
Re: (Score:2)
Not very much, admittedly; only two years paid work on 8-bit microcontrollers. I'm sure you have more and wider professional experience in the area than I do.
However, I came from a background in compilers, so the source file of the "simple assembler that starts at the reset vector" that I had to write was named crt0.s.
Re: (Score:2)
Re: (Score:2)
Who are you quoting?
Re:Feature complete with a small runtime? (Score:5, Funny)
The Dao that is feature-complete is not the true Dao.
Re: (Score:2)