Slashdot Mirror


Tao3D: a New Open-Source Programming Language For Real-Time 3D Animations

descubes (35093) writes "Tao3D is a new open-source programming language designed for real-time 3D animations. With it, you can quickly create interactive, data-rich presentations, small applications, proofs of concept, user interface prototypes, and more. The interactivity of the language, combined with its simplicity and graphical aspects, make it ideal to teach programming.

Tao3D also demonstrates a lot of innovation in programming language design. It makes it very easy to create new control structures. Defining if-then-else is literally a couple of lines of code. The syntax to pass pass blocks of code to functions is completely transparent. And it is fully reactive, meaning that it automatically reacts as necessary to external events such as mouse movements or the passage of time.

The source code was just made available under the GNU General Public License v3 on SourceForge [as linked above], GitHub and Gitorious."

9 of 158 comments (clear)

  1. Re:Where is IF-THEN-ELSE more verbose than that? by descubes · · Score: 3, Informative

    The actual definition of if-then-else can be found here. It looks like this:

    // If-then-else statement
    if true then TrueBody else FalseBody -> do TrueBody
    if false then TrueBody else FalseBody -> do FalseBody

    if true then TrueBody -> do TrueBody
    if false then TrueBody -> false

    The definition of the 'for' loop is more convoluted and is actually found in C++ code. It looks like this:


    FORM(IntegerForLoop, tree,
              "for Var in Low:integer..High:integer loop Body",
              PARM(Var, tree, "")
              PARM(Low, integer, "")
              PARM(High, integer, "")
              PARM(Body, source, ""),
              return xl_integer_for_loop(context,self, &Var, Low, High, 1, &Body), )
    FORM(IntegerForLoopStep, tree,
              "for Var in Low:integer..High:integer by Step:integer loop Body",
              PARM(Var, tree, "")
              PARM(Low, integer, "")
              PARM(High, integer, "")
              PARM(Step, integer, "")
              PARM(Body, source, ""),
              return xl_integer_for_loop(context,self, &Var, Low,High,Step, &Body), )
    FORM(RealForLoop, tree,
              "for Var in Low:real..High:real loop Body",
              PARM(Var, tree, "")
              PARM(Low, real, "")
              PARM(High, real, "")
              PARM(Body, source, ""),
              return xl_real_for_loop(context,self, &Var, Low, High, 1.0, &Body), )

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  2. Re:The Republicans... by jones_supa · · Score: 2

    Americans can twist any topic to be a battle between democrats and republicans. Actually, a fun party game would be one where someone tries to make up a topic that cannot be made into such a battle, such as "eyeglasses". Then the opponent tries to refute that by making it a political turmoil such as "we would get much higher quality and cheaper eyeglasses if the republican clowns were not cruising the ship".

  3. Re:Video tutorials by descubes · · Score: 2

    Here are a few links:

    Tao3D documents on Gitorious

    Taodyne tutorials usually have the code corresponding to the videos. But I'm pretty sure our small server won't take a slashdotting. Use it while it lasts.

    There are also a few examples in the source tree itself.

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  4. Re:Most uninteresting by Dutch+Gun · · Score: 2

    Where did you see an example of the language? The links went to sourceforge (I didn't want to install the package just to see the language) and a marketing video.

    Defining if-then-else is literally a couple of lines of code.

    I'm curious how anyone thought that if/then/else was a difficult enough construct in popular languages such that it needed improving. I mean, it's a couple of lines of code in *any* language, isn't it? Anyone know how this language supposedly improved on the concept?

    The syntax to pass pass blocks of code to functions is completely transparent.

    So, functions are first class data members? Is it weakly typed then, like Lua? In that language, defining a function is just syntactic sugar for assigning a chunk of code to a variable of the assigned name, so you can use it just like any other variable.

    I'm also curious what this particular brings to the table that a library couldn't have accomplished. Learning a new language is a fairly big hurdle for someone to take to develop for a particular platform. Part of the reason I think we have so many computer languages is that programmers simply love writing new languages, not that it really solved any new problem. Nothing wrong with that, but then again, don't expect us to care unless there was a good reason for the new language.

    --
    Irony: Agile development has too much intertia to be abandoned now.
  5. Re:Most uninteresting by descubes · · Score: 4, Interesting

    Where did you see an example of the language? The links went to sourceforge (I didn't want to install the package just to see the language) and a marketing video.

    There are a few code examples in the marketing video. There are several additional examples on the Taodyne web site, but I'm pretty sure it can't take a slashdotting.

    I'm curious how anyone thought that if/then/else was a difficult enough construct in popular languages such that it needed improving. I mean, it's a couple of lines of code in *any* language, isn't it? Anyone know how this language supposedly improved on the concept?

    The idea is that in other languages, if-then-else is a built-in construct. You can't do something similar yourself without hacking the compiler. In Tao3D, if-then-else is a library element like printf in C. So you can change it.

    Let's say you often use a specific kind of for loop. In Tao3D, you simply add the notation you need, and now your code is shorter and more concise. Once you decide that one of the language objectives is that you can extend it yourself and create your own domain-specific languages, it's obvious that a good test for that feature is to use the basic programming language constructs found in other languages, like if-then-else or for loops.

    So, functions are first class data members? Is it weakly typed then, like Lua? In that language, defining a function is just syntactic sugar for assigning a chunk of code to a variable of the assigned name, so you can use it just like any other variable.

    The part that is always verbose in existing functional languages (except maybe Lisp) is how you pass code to another function. For example, in Javascript, you'd pass a callback with 'function() { ... }'. In Tao3D, I got rid of everything but ..., and the language is smart enough to figure things out. This means that you can define a slide by passing bullet points, and it almost looks like Markdown, whereas if I was in JavaScript, I would need layers and layers of code. This particular aspect is detailed in an article called "Storytelling, the web is doing it wrong"

    In Tao3D, you define the notations you want first, you design the (domain-specific) language around your notations second. In existing languages, it's the other way round, the notation is imposed by the language you chose.

    I'm also curious what this particular brings to the table that a library couldn't have accomplished. Learning a new language is a fairly big hurdle for someone to take to develop for a particular platform. Part of the reason I think we have so many computer languages is that programmers simply love writing new languages, not that it really solved any new problem. Nothing wrong with that, but then again, don't expect us to care unless there was a good reason for the new language.

    That's a very good point. The reason for XLR (the language underlying Tao3D) was that we have to invent new languages all the time, not because we like to, but because existing languages are very bad at accepting something that is not already in their DNA. You could not get lambda functions in C++ until the language committee sat around a table, standardized it, and then all compiler vendors had to implement it. But if what you need is for example a notation for symbolic derivative, or a notation for slides, or a notation for a specific kind of for-loop, you are stuck. So progress in programming languages is very slow, because each language adds its own little features, but drops tons of other features that already exist in other languages.

    The idea with XLR was to create a language where the fundamental process was extending the language. And Tao3D is an example of a relatively large scale domain-specific language (specifically around 3D and animations). Most of it is precisely in a library. But you wouldn't know from using it. It feels "native".

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  6. Smalltalk made new keyword creation easy in 1980 by Paul+Fernhout · · Score: 3, Interesting

    http://en.wikipedia.org/wiki/S...
    "Control structures do not have special syntax in Smalltalk. They are instead implemented as messages sent to objects."

    Smalltalk still has one of the best programming syntaxes, IMHO because it clearly tags each argument in a complex message like "widget placeAtX: 10 y: 20.". And Smalltalk is gradually being reinvented piece by piece ranging from things like the Java JVM to things like JavaScript's object literals and JSON, e.g. the Smalltalk looking: {x: 10, y: 20}. As another comment pointed out, Forth, Joy, Lisp and other languages also support this in various ways (Lisp very painfully compared to the others via hard-to-write macros).

    Also, why do people keep making new languages with new syntax (generally with poor to missing error messages, debuggers, IDEs, documentation, and libraries) when we would so much more benefit from improved FOSS libraries for existing ones? I'd be a lot more excited about Tao if it was a JavaScript library that just supported some special format INI files. It seems like Tao has some impressive libraries for real time graphics that would be nice for anyone to use. Why hide the library for most users behind some new syntax? Most of the hard work must have been creating the library I would guess?

    Of course, I know the answer to that. :-) Writing new programming languages is fun, and I have done it before myself more than once. I still have some more ideas I'd like to try out, like to take Smalltalk and have it use C-like comments and string and have a different (hopefully faster) approach to dispatching messages. And to some extent, every major programming problem we solve requires writing a sort of mini-language in terms of function names and such to define a problem space and possible solutions.

    It's sad that we got stuck with JavaScript and all its warts just because someone had to rewrite Scheme from scratch with a C syntax in two weeks to stick it in an early browser. Brendan Eich made an unfortunate choice about default variable scope and not including modules from the start based on the idea it would only be for small one page scripts (plus various other warts and complexities like relating to closures and variable scopes, variable hoisting, and so on).

    Looking at a bit of the Tao overview video on SourceForge, it looks like variables don't need to be declared (ick!). Also, requiring "locally" seems to imply that it has one of the worst "features/bugs" of JavaScript design for default globals? Or maybe I did not understand "locally". The main aspects of the language (like what is a code block, what is an argument) don't seem clear at first glance to me, perhaps because of various keywords being defined or seeing commas some places and not others?

    I find the use of a comma without inner parentheses interesting for functions and arguments, where the comma in a sense is doing what Smalltalk keyword colons are doing. Still, it misses labelling arguments like Smalltalk, and why not drop the commas and just have all arguments separated by spaces and instead require nested expressions to be surrounded by parentheses if you are going in that direction? For example: "translate -500 100 (10 + x)"

    I like the clean looking syntax without semicolons at the end of lines. I'm assuming it uses indentation after a comma to define code blocks? Although maybe not, since I only see that at the top level? So, some interesting ideas and I wish it well. It it ran on JavaScript, maybe I'd try it today...

    If you're the author, despite any criticism above (just half-baked opinions from watching the video for a few minutes on-and-off while writing this), I'd still encourage you to keep moving forwards with it. Looks like a lot of fun! And it is exploring some new ideas and the library looks amazing. There is no question popular computer languages (Java, JavaScript, C++) have many warts and someday it would be great to have better langua

    --
    A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
  7. Re:Smalltalk made new keyword creation easy in 198 by descubes · · Score: 2

    Your post is long, so I'll only address a few snippets by lack of time.

    Also, why do people keep making new languages with new syntax (generally with poor to missing error messages, debuggers, IDEs, documentation, and libraries) when we would so much more benefit from improved FOSS libraries for existing ones? I'd be a lot more excited about Tao if it was a JavaScript library that just supported some special format INI files.

    The answer is complex. I try to address it in this article. It's not just for the sake of inventing a new language, it's because what I wanted to do I could not do with JavaScript.

    Looking at a bit of the Tao overview video on SourceForge, it looks like variables don't need to be declared (ick!).

    Variables need to be declared, but an assignment does declare a variable in that scope.

    Also, requiring "locally" seems to imply that it has one of the worst "features/bugs" of JavaScript design for default globals? Or maybe I did not understand "locally".

    The 'locally' function does not concern variables, but graphic state. It's a way to say "I don't want this rotation to escape this block". In OpenGL terminology, you can think of it as a PushMatrix/PopMatrix pair (and same for other attributes).

    The main aspects of the language (like what is a code block, what is an argument) don't seem clear at first glance to me, perhaps because of various keywords being defined or seeing commas some places and not others?

    I find the use of a comma without inner parentheses interesting for functions and arguments, where the comma in a sense is doing what Smalltalk keyword colons are doing. Still, it misses labelling arguments like Smalltalk, and why not drop the commas and just have all arguments separated by spaces and instead require nested expressions to be surrounded by parentheses if you are going in that direction? For example: "translate -500 100 (10 + x)"

    If you define something like:

            translate X Y Z -> translate X, Y, Z

    then you probably are close to what you want. In practice, this forced me to add many parentheses (as you just did), and I found using a low-priority comma to separate arguments was much more practical.

    I like the clean looking syntax without semicolons at the end of lines. I'm assuming it uses indentation after a comma to define code blocks?

    Yes.

    It it ran on JavaScript, maybe I'd try it today...

    If someone wants to give Emscripten a try ;-)

    If you're the author, despite any criticism above (just half-baked opinions from watching the video for a few minutes on-and-off while writing this), I'd still encourage you to keep moving forwards with it. Looks like a lot of fun! And it is exploring some new ideas and the library looks amazing. There is no question popular computer languages (Java, JavaScript, C++) have many warts and someday it would be great to have better languages (again though, Smalltalk and message passing is my favorite, even as I move to JavaScript now for various reasons).

    Thanks for the encouragements.

    Still, if you haven't already, you might want to make an ANTLR ( http://www.antlr.org/ ) grammar for Tao3D and generate JavaScript for a backend to the animations which uses asm.js for speed and so it can run easily in a web browser. Then people with a compatible recent browser could just click on a link and be up and running with Tao.

    I have other plans to achieve that same effect. What out for Buddda ;-)

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  8. Re:Smalltalk made new keyword creation easy in 198 by Paul+Fernhout · · Score: 2

    Thanks for the reply, especially explaining "locally" (I was starting to wonder afterwards if it indeed was about 3D transformations not variables). Interesting point on commas vs. parens for clarity; I'll have to think about that.

    Could not easily find a Google ref for "Buddda". :-)

    On JavaScript, it is a frustrating language to work with, with several major design flaws. I'm using it right now for a mid-size project (dozens of pages in a single-page app, collecting 500+ different pieces of data, using Dojo) and it is painful and dragging on (even in just Java, it would have been done much faster). But, inspired in part by Dan Ingall's work on the Lively Kernel, plus what many other peopel say and do who all agree how badly JavaScript sucks, the fact that it runs (in theory) everywhere with one click is the big win. The URL is the biggest innovation there. As I've said before, if it does not have (or run from) a URL it is broken.

    Everyone agrees JavaScript sucks:
    https://www.google.com/search?...

    There are many such things on the web:
    "Why JavaScript Sucks And You Should Use It Everywhere"
    http://www.youtube.com/watch?v...

    It mentions asm.js, BTW.

    Check out where the implementer of Smalltalk (Dan Ingalls) is doing now (very dynamic JavaScript): http://www.lively-kernel.org/

    Perhaps the fairest thing to say about JavaScript though is:
    https://news.ycombinator.com/i...
    "[JavaScript] is actually a very strong language with a few very well known warts (like every other language on the planet has). The problem is that people try to use it as if it were Ruby, PHP, Python, Java. One can do that, but just know that it is an exercise in futility. It will cause frustration and one will come to the conclusion that JavaScript sucks when in fact, it is just that most people don't really take the time to _understand_ JavaScript."

    A big issue with JavaScript in practice for simulation (typical to go with 3D) though is that, by default, it is essentially single-threaded (yes, other things are possible with webworkers and separate processes and such, but not in practice for most users). Having spent years debugging subtle issues with Java threading in a huge real-time-ish high-visibility high-availability app, I'm not fully sure that's a bad thing though. :-)

    BTW, I think there are lots of value to making a big project FOSS, but rapidly getting contributors to do major changes right away (like a move to a web browser via JavaScript and emscripten) is generally not one of them. The big win is often when being free and available brings in small polishing changes and add-ons and also, if the software is written in a modular way to begin with, getting major new modules as part of an ecosystem -- as well as getting broader adoption by being free and open to increase demand for the core developers' other services and related books and training and other addons and so on. In practice, the learning curve for any major project is just too high for a casual use to make a significant core change, and even if they do, the core maintainers may reject the change or make other changes separately that cause bitrot in the change. If emscripten would just run on the core code, maybe someone would try it. But my guess is it require some code changes to the C++, changes to XL as mentioned elsewhere to output JavaScript, other changes to work with OpenGL as you mention on the page, and some JavaScript glue code to have an app, so non-trivial enough that few people will try it as a first thing (unless maybe they already have used emscripten several times). With an expected big effort, then the question is, what is the payoff for taking the risk? That payoff is going to be much bigger for the original authors probably than for some ra

    --
    A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
  9. Re: Most uninteresting by Anonymous Coward · · Score: 2, Interesting

    I recoded a 25-hour number crunching app at work in C++ with lock-free threaded workers that trimmed that job down to 17 minutes. I then made them purchase Intel Compiler (ICC) and a simple recompile brought that time down to 13 minutes.

    The machine it ran on has top of the line Xeons with a terabyte of memory and redundant PSU's along with some GPU code.... An unexpected side-effect of my optimizations was that the power bill dropped on our cage by an order of magnitude.

    So enjoy your huge power bills with all that quickly churned out inefficient code..... No one talks about that as a developer but literally C++ is green and saves some of that extra development cost by allowing for cheaper power bills if the machine isn't doing anything else but your app.