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."

3 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: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
  3. 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.