Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Point? (Score 1) 158

from the information I had from you, produced 3d extruded text more efficiently.

Then you misinterpreted the information I gave you, because my point was that designer, ideographic or Arabic font have complex outlines. AFAICT, Three.js cannot use such fonts (maybe there's a trick I don't know).

What does Tao3D offer over competing products like these?

These are all great products. What Tao3D offers is:
1. It's notably cheaper, and now there's also a free software version.
2. It's a programming language. That being said, I know Ventuz can at least be scripted, not sure about the other two.
3. Stereoscopy and auto-stereoscopy are just a mouse click away. Ventuz can do some, but it was convoluted last time I checked.
4. Tao3D automatically checks if media, files, sources changed, and reloads them. Great for remote-controlled updates.
5. No need to import media, Tao3D uses media in place (that used to be an issue in Ventuz and Aurora3D, not sure if that's still true).

In a sense, Tao3D is to these tools what a web browser is to Powerpoint: open, extensible, flexible, but harder to get started with. And in this analogy, we see the web-based interface in Tao3D as the equivalent of Wordpress, i.e. a solution to separate concerns between editors, page designers and media content producers.

Does that make sense?

Comment Re:Point? (Score 1) 158

Ah, I missed your point completely in the GP. Sorry.

The problem it addresses is the complexity of creating the simplest 2D or 3D scripted animation, and how this process does not scale or compose well.

Here are a few random examples:
* Create Christmas card pictures for all my friends that are automatically tailored for each of them.
* Display fragile objects in a museum, photographed in 3D (or scanned), shown in 2D, in 3D or in glasses-free 3D
* Display complex data or simulations for a scientist, in a way that can be explored interactively or shown at conferences.
* Teach about fractals by showing interactive models of various fractals.

I'm conscious that with enough effort, some of these can be done with other tools. The purpose of Tao3D is to reduce the effort manyfold.

Comment Re:Most uninteresting (Score 1) 158

I don't see the lambda calculus in your example.

There was none, indeed. In reality, Tao3D is based on tree rewrites, not lambda calculus.

I'm exploring a bit here what the implications are. Quite frankly, the type system as implemented is totally incomplete and still largely broken at the moment. I understood what needed to be done after 5 years of experimentation, and never got the time to actually implement it. Similarly, the language reference describes a runtime environment for functions, how closures and symbol tables are defined, etc. I prototyped this and got a basic compiler half working, so I know it will work. But the symbol table in Tao3D is a more ancient design, in C++, not visible to the program.

That being said, there are "anonymous tree rewrite" notations very similar to lambda calculus. For example, here is how you can draw an almost convincing Christmas tree:

color "darkgreen"
foo with (X -> 3*X^2+7) with 1..8, 2..4

foo R ->
        rectangle 0, 0, R, 18
        translate_y -20

The with operator here implements a map, i.e. we apply foo with the result of an anonymous rewrite (that's the "lambda") with a list made of values 1 through 8 and then 2 through 4.

The filter operation is implemented with another syntactic form:

foo with (X where X mod 2 = 0) with (X -> 3*X^2+7) with 1..8, 2..4

There's also a reduce operation, but it crashes the compiler at the moment, need to see why:

foo (X,Y->X+Y) with (X where X mod 2 = 0) with (X -> 3*X^2+7) with 1..8, 2..4

Comment Re:Point? (Score 1) 158

With my computer, a code editor, and the (easily accessible) documentation. It took about 10 minutes.

I meant: you probably have some code that looks like:
var geom = new THREE.TextGeometry(T, { size : S, height: H, curveSegments: CS, font: F });
I was interested in the parameters to that code.

That statement is either completely false or incoherent. Care to give it another go?

Unless you are rendering bitmap fonts, at some points, your glyph outlines are first rendered to the texture. It may be 2D, chances are it's still done by the graphic card on modern systems.

Sure. What I'm saying is that, from the numbers you've provided, your product clearly lots of room for improvement. Even with basic Latin, you're averaging 128 triangles/character for flat text!

Actually, you are right, the code I quickly implemented was counting the array elements, not the polygons. So, roughly, the number of edges, but counting terminating edges in triangle strips multiple times. My bad. I guess I'm getting tired. The point I was trying to make remains valid: some real fonts (as opposed to the toy fonts in Three.js) quickly generate huge amounts of polygons.
As another illustration of my point about WebGL, I can see the Three.js geometry / text example on my iPad, but not on my iPhone 4 or my Android tablet. Maybe you are more lucky with your BlackBerry...

I'm still not convinced the project offers anything over existing solutions.

I'm sorry I did not convince you. But Tao3D does offer a lot over existing solutions.

First, Tao3D is the only practical solution I know for delivering interactive 3D animations, simulations or presentations quickly. What you can do with Tao3D in 25 lines of code is nearly impossible today with Three.js: no support for real TruType fonts, no text layout for 3D meshes, no RTL text support, etc. And I'm just talking about text here. We can do full slides in 3D with 25 lines of code when Three.js is barely capable of doing one line of text in 600+ lines of code at the moment, and then only with relatively serious 3D programming. Tao3D requires 24 times less lines of code. And you say we bring nothing new?

That brings me to the second big contribution. Even if you add text layout features to Three.js, you will still be working at the wrong semantic level, talking about meshes and renderers and such. Again, someone might work this out the way Reveal.js attempted to do for slides. But Tao3D does this today. Today, with Tao3D, you talk about "slides" and "paragraphs" and "color", because that's what you care about.

Finally, a third innovation in Tao3D (though not in the libre edition) is transparent support for practically every stereoscopic or auto-stereoscopic screen under the sun. So you can playback 3D movies without glasses, superimpose 3D text and logos, etc. In the digital signage space, Tao3D brings glasses-free 3D screens at feature parity with 2D screens. And that's also a pretty significant contribution.

I can understand your need to defend it against any and all criticism, real and perceived

Not any criticism. Against uninformed criticism, of which there is a lot on Slashdot, unfortunately.

How is your startup going? What markets have you found the most success? Where do you see the product in the future?

I noticed your "failing" startup comment earlier, don't worry. Like any startup, not enough cash, too many ideas, not enough people, too many things to do, not enough time.

Our current markets include exhibitions, e.g. trade show, museums, etc, high-end presentations, scientific data visualisation and 3D advertising. Others we know we can address include education, point-of-sales, automated image processing and generation, ... And if 4K glasses-free 3D TVs start taking off, we can deliver a 3D GUI for set top boxes today. As far as I know, nobody else is close.

As for where I see the product in the future, please allow me to keep that to myself for the moment.

Comment Re:Point? (Score 1) 158

Just to clarify, the poly counts I gave were actual triangles processed by the card when disabling texture-based rendering in Tao3D. This is the only case that always works, so it's both the fallback scenario and the worst case scenario. Therefore, that's the one I'm most interested in.

Not extruded? Why not render the text as a texture and slap it on a triangle strip?

Obviously, Tao3D does that when that's possible.

Why not render the glyphs as a large texture and make clever use of UV's?

Tao3D also does that when it makes sense.

(You'd use more triangles, 2 per character

Hmm, how do you draw a glyph with only one triangle per character? Or do you mean that we can use two triangles for multiple characters? We also can store full words in the glyph cache. But currently, we only use that for languages with ligatures such as Arabic.

but that's still way fewer than the approach you're using.

May I suggest that you should study how the Tao3D code works a little more before being so dismissive ;-)

You might also want to look at other, clearly more efficient, solutions. Take a look at three.js's ShapeGeometry. and ExtrudeGeometry -- A quick test shows great quality, with far fewer triangles.

Quick test with what? How did you create a text mesh with Three.js to start with?

Furthermore, as soon as you extrude, you need true polygonal rendering. You can't draw on a texture and render quads or two triangles as you suggested. Or if there's a way, I don't know it. So you end up with roughly the number of polygons in the base glyph x N, where N depends on extrusion parameters, e.g. if you create a bezel or not, if you round the bezel, and so on.

That being said, if you want the text to look any good, you have to emit a large number of triangles for even relatively simple text.

On the basis of my experience, I strongly disagree.

Would you please be kind enough to share your experience? That's a hot topic for me.

First, I'd like to point out that even if you can do texture-based rendering, you still need to first render to a texture with polygons or, alternatively, with triangles and a shader doing the Bezier fill.

Let's deal with two cases here. The first case is when texture-based glyph caching applies. In that case, polygon count is rarely a problem for alphabetic languages. For ideographic languages, or languages with ligatures such as Arabic, the chances of finding what you need in the glyph cache are lower, but you can still assume you will draw the same text several frames in a row, so that's still a net win. The animation may skip a bit when the text changes though... So basically, the glyph polygon count defines the worst case "skip" you can get. And westerners don't care, since they use a Latin alphabet with an appropriately low number of glyphs. So in general, we can reuse entries in the glyph cache.

Second case is when you can't use textures. Extruded 3D text is one scenario, that's hardly the only one. Then, you need true polygonal rendering. And the number of basic triangles you had for the front face is multiplied by N, which depends on the shape of the extrusion path (bezel, rounded bezel, etc). Plus this time, you need to render the polygons at every single frame, so polygon counts start playing a big role in performance.

In all cases, even with an curvature-dependent algorithm, you still need a decent number of polygons per glyph or any non-basic font looks like crap. I think the best you can do is something like one triangle per Bezier curve in the glyph (unless you want your shader to become really something). Without a Bezier shader, you need at least 5 or 6 times more (depending on how sharp the curves are). In the extrusion case, you can't use textures, and you can't use Bezier shaders either.

In short, drawing "Hello World" spinning in 3D Arial font is something that anybody can do. Fetching text from an Arabic or Chinese news site and drawing that on the screen continuously, that's a different challenge entirely, and one I reckon a Blackberry won't be able to deal with too happily. At least, that's my opinion today. You may easily prove me wrong by porting Tao3D to a Blackberry :-)

Comment Re:Video tutorials (Score 1) 158

Thought for the day: whenever designing something for other people to use, you should take all feedback from your potential users and prove to yourself why the feedback is correct before attempting to show the giver why it's wrong.

Oh, I got it backwards then. I thought you had been trying to prove me wrong all that time... Sometimes, you were right (e.g. black characters on black background). Sometimes, you've made a good point (e.g. align_vertically). Sometimes, I feel your point is less convincing (glTranslate and glColor). Sometimes, I think you are plain wrong (global state is evil), and I express disagreement. That's how a discussion goes. I enjoyed it, sorry to hear that you did't seem to.

if your default response is to prove to everyone that their feedback is so valueless to you

If it felt so valueless to me, do you think I'd still be watching for your answers and typing this in the middle of the night? I don't claim to be perfect. Please reciprocate.

Exercise for you: go **** yourself. That's just patronising.

No, that's trying to help you become an early contributor. I would not have spent the time locating the exact line to patch otherwise. Remember, open source is about you and others being able to influence Tao3D. But since you obviously don't want to do it this time, I patched it myself. Your name in lights, tadaaa.

If we were just talking about text flow in a 2D page, I would agree with you

Well, text layout is still done in a 2D text box. So align specifies the horizontal alignment and justification within a line (the frequent case), and align_vertically the alignment and justification of the lines and paragraphs vertically.

I understand that, but it's wrong. I know a lot of people laugh at the idea of using setColor and getColor as per so many OO style guides, but really, you either need to use assignments or use verb-based names, or the syntax is broken from a human cognitive perspective

It's an interesting point. Tao3D actually went the other way. A setter and a getter for a property typically have the same name. So to adjust the stereoscopic effect, you can say something like eye_distance 20, and that adjusts the property you get with eye_distance. To get the current theme of a slide, you use theme, and to set it theme "Master". I personally see the 'set' and 'get' in that case as noise. But I will admit it's a matter of personal taste. I hope you will understand that Tao3D reflects my tastes and not yours.

At the limit, we began implementing (but never finished) a system of properties named x, y, width, top and so on for coordinates. You could then use any of the following three, to your liking:

rectangle 10, 20, 30, 40
rectangle { x 10; y 20; width 30; height 40; }
rectangle { left -5; y 20; width 30; bottom 0; }
x 10; y 20; width 30; height 40; rectangle

Much like for color, the last one would also set the properties in a persistent way for following shapes to use, much like color or texture today. This means you would then be able to say something like left 20 to left-align a bunch of shapes. It's not done yet, but still in the plans.

They are broken. If you aren't willing to fix the real problems with languages, why write a new one in the first place? Why not just write a library?

I find your use of bold font and "broken" quite antagonistic to your statement that two people can be correct at the same time. You call this a real problem with languages. I just don't see it. Specifically, I don't see color "red" or glColor as broken. In doing so, I'm not saying that you are wrong, but I am not convinced by your attempt at proving me (or OpenGL) wrong either. I see it more as a taste than as a matter of right or wrong.

"show" changes state? That's not what I would expect from the English word. To "show" is just to display, present or make visible something that already exists.

In Tao3D, there is a global "visibility", a floating point value between 0 and 1, that applies to all drawings. When you use show, you change the visibility. Granted, not the best choice of verb. Find a better one, and I might patch that as well. Or you might submit one if you don't go all ballistic again at the suggestion that the code is open :-)

It's not FUD [...] But if what is conceptually one thing is distributed, you might miss a bit and attempt to define two cases for the same input pattern.

What happens in that case is well specified by the language. You know which pattern wins. Just like if you have a global variable named 'i' and a local variable named 'i' in C, you know which one is selected by the compiler. It might lead to bugs. And in the case of C, it has.

The FUD is using the might as an argument against the feature. If you read the subtext, "Be afraid of the possible consequences" turns into "That feature is evil" turns into "Don't use that language". That's the very definition of FUD in my book. Which does not mean that the fear is unfounded, by the way. But it's on the same level of risk as naming conflicts in any language. Good naming or pattern usage conventions deal with it quite well. I have yet to run into such a conflict myself.

PowerPoint users don't need that much power.

Powerpoint users are not my user base. Tao3D is to Powerpoint what a fighter jet is to a bicycle. It takes more skills and time, you can't use for your everyday shopping/business talk. But if you know how to use it, you can take advantage of the third dimension. So Tao3D was designed for those users who need the power.

in all likelihood users will be writing very, very small programs

Actually, no. One of our first users actually wrote a C++ module to read some scientific data. A typical commercial use of the software is around 5K to 10K lines of code. So not very big, but not "very, very small" either (especially given what you can do in 10K lines of Tao3D).

Your users need something that is simple, straightforward, and tightly constrained. I've worked editing company collateral, and if I'm sent a slide deck at 9:30am to use for a lunch-time meeting at 12:30, I want to be able to go in and change things quickly, without having to debug all the side-effects of persistent-state code. This means I'm not going to be able to reliably adapt and update the slides as things change.

Actually, that's not true. One thing my customers appreciate is that I edit stuff while it's showing on a projector, from a text editor in a window on my laptop. And for common tasks that fit well in a standard template, we have the web-based editor, that generates code for you.

Most of your potential marketplace aren't programmers, I am, but even I wouldn't be able to use your product in a business environment.

I agree. This is why we have the web-based and template-based editor. The idea is that you have samples of code with parameters, and that the web user interface lets you tweak only the parameters that the template designer left open. This is still work in progress, though. Most templates remain to be added.

I am an exceptionally good user to listen to, but instead of taking my input, you're telling me I'm wrong.

Did you make the "Powerpoint" argument before? Did I tell you you were wrong, ever? You write "wrong" all over the place, and "broken" in bold, not me.

Just curious, what do you mean by "exceptionally good user to listen to"? I know very little about you, sorry to ask.

First rule of startups: don't assume you know the answer

Second rule of startups: bring something new. So we don't do a Powerpoint wannabe. For that, there's Keynote, Prezi, and dozens of dead products. And LibreOffice Impress if you want free software.

(in my opinion as a potential expert user of your product, remember)

This is a bit my problem here. You already consider yourself an expert when you have not used Tao3D for one week. You are not an expert at Tao3D, sorry. Yet you insist on telling me everything I did wrong. Not helpful.

So why does the demo redraw the shapes with different colors at every frame? Because that's what my program was requesting, that's why. Now if you want to know more about the execution and drawing model of Tao3D, read this. And you'll see that it's a bit smarter than re-creating everything every frame.

No, that's what makes it hard to use. You're the designer, I'm the (potential) user -- it's not your job to tell me what I find easy or not.

Are you positioning yourself as a user, or as an alternate designer? Apparently, you tell me "this design is not good, you should have done it that way", without even having tried our current design. You think you became an instant expert by watching one video on YouTube? You think you can demand changes in the design because you are a potentialuser?

More to the point, the alternative designs you are referring to are well known. This is the model in WebGL, for example. Why do you think the DNA example would be easier to code in WebGL, Three.js or something similar? Here is a DNA-like structure, without text (that would be harder with WebGL). It's 139 lines of code, not counting the many Javascript libraries required to do it. My DNA example is 42 lines of code, with the text. That's one objective measure of simplicity...

In short, I'm not telling you what you should find easy or not. I'm telling you what I find easy or not, and I don't take at face value your theories when my own experience contradicts them. My experience tells me that Tao3D code is short, easy to write, easy to read, to the point. And that all the alternatives I tried are nowhere as good for the specific things that Tao3D is designed to do.

From the point of view of a non-coder (or even many coders) the idea of recreating the same "artefact" for each frame is confusing.

To me, talking about "frames" or the "creation of shapes" is already pretty confusing. Conceptually, drawing is immediate. The fact that it actually is not is an implementation detail.

But of course, optimising drawings and computations is important. So there are tools like cached or frame_texture to cache 3D or 2D drawings. Here is an example with cached if you are curious.

It's that word "powerful" again -- a long rope is more powerful than a short one, but it means giving the user enough rope to hang themself.

Hmmm, that does not seem to match the quote line just above that sentence. Not sure where this was supposed to go...

Again, the job of a designer is to be better than what has come before

Yes, I agree. Tao3D does something no tool I know ever did before. It enables me to create powerful real-time 3D animations in minutes. That, it does better than what has come before. The rest, I don't care. And even if I generally use Tao3D rather than Powerpoint, that does not mean it's meant to be a replacement. Powerpoint has never been described as a "programming language" that I know of. Yet if you look at the title of that Slashdot story, it says "Programming language". You brought up Powerpoint, not me.

Anyway, the original point in your criticism was that global state was evil (if I understood correctly). I answered: no, it's perfectly fine, and there are tons of industry standards to prove it.

Because the whole system is utterly opaque... Not going to use it.

Well, the source is open, there is a lot of documentation, there are many examples. The drawing logic you criticised is modelled after OpenGL, arguably the leading 3D API in the industry. What else can I do to make it less opaque? Or, by "opaque", do you mean that you are not yet familiar enough with it to understand how it works? If that's really the problem, give it a couple of weeks.
To answer the question about what you rotate: it's the objects, or what OpenGL calls the "model/view matrix". So if you say rotate_z 20; rectangle..., it's the rectangle that you rotate. Just like if you say color "red"; rectangle... you apply the color to the rectangle.
As for not using it, you are a free man! I still hope Tao3D will prove itself useful to you someday.

There's something missing here, but I can't quite put my finger on it....

Of course, you realise that it's by design that we don't force our users to type useless zeroes and to write rectangle 10, 20, 0, 30, 40, 0? For the 3D version, there's cube for example. You can also extrude 2D shapes to give them a 3D look.

You could have achieved consistency by using coordinates and vectors as abstract types

Again, playing the role of the designer here, not the user. There are dozens of other ways this could have been done. Your idea of consistency is different of mine, and your suggestion does not feel like an improvement to me. But again, the code is open. If Tao3D gives you an idea and you want to fork it to create a high-consistency version with abstract types and n-dimensional vectors, you have my blessing. But suggesting I should have done this your way or else it's broken is not helpful.

And yet people don't define PowerPoint slides by a series of command-line directives, and more people write letters in Word than LaTeX... You really need to remember who your audience is.

My audience here is Slashdot. Which last time I checked was "News for Nerds", not "News for Suits". I'm not looking for Powerpoint slide pushers. If you are a good enough coder to be able to use Tao3D instead of Powerpoint, go ahead. If you want your pointy-haired boss to reuse your slides... don't count on me. I described a programming language for 3D animations. If you really want a 3D Powerpoint, check out Aurora 3D.

Comment Re:Video tutorials (Score 1) 158

I don't like subroutine names that include something that looks like a parameter, so things like rotatex and rotatey set me on edge a bit.

If you prefer, you can use the plain rotate. But rotating along X, Y or Z is frequent enough to deserve a shortcut. Not different from CSS transform, by the way.

It gets worse when this is inconsistent, and you see a subroutine called vertical_align for vertical alignment, where the seeming parameter (vertical) is now before the generic (align), and separated by an underscore instead of run together. Not only is this an internal inconsistency, but it's inconsistent with English, as "align" is a verb, and we would put in an adverb "vertically" after the verb normally. And then it gets worse again, as the command for horizontal alignment is... "align".

You are right, align_vertically would be more sensible. Exercise for you: fix it ;-) As for align, that's the common case, so I'd rather keep it that way.

The grammatical inconsistency continues with other commands/subroutines taking on names with no verb component at all (eg the command color, with no verb or assignment operator.

That derives from OpenGL, which has glRotate and glTranslate, but glColor and not glColorize. BUT it's not inconsistent. It's actually fairly smart. The color is an attribute, and glColor just sets it. So the name is the name of the attribute you set. glRotate and glTranslate modify an attribute (the current model/view matrix), so they are verbs. Unwittingly, I applied the same logic for things that change the color state, e.g. show. Since show changes the color state, it is a verb.

I'm really not happy with the way pattern matching is used as overloading ...because you can get yourself in a mess if you split it up into different parts of the code and accidentally overwrite stuff.

How is this different from overloading? That's a FUD argument. In reality, its distributed nature is exactly what makes the construct powerful. It offers a very flexible dynamic dispatch mechanism.

For example, the Slides module draws a background for slides using theme_background. That function is provided by the default theme. But most themes will override it.

In general, this override happens only on part of the pattern. For example, most slide elements are defined by (theme, master), sometimes (theme, master, style). The "master" is the equivalent of the Powerpoint "slide master", i.e. it defines the layout, etc. If you define a new theme, you'll typically define overrides that catch everything for a given theme (e.g. for "BrightRectangles" in the last link). But you may also want to override for a specific combination.

I'm completely baffled why the whole demo recreates the shapes for every single redraw frame rather than keeping them as persistent objects (which necessitates adding a random seed in order to fake them being persistent by pulling up the same colours each time.

The Tao3D drawing model is a feature, not a bug. If you write rectangle 0, 0, 320, 200, it draws the rectangle once, and that's it. If you write rotate_z 6 * seconds; rectangle 0, 0, 320, 200, it redraws it once per second. If you change the color at every frame, then of course it has to re-create it every frame... That's what makes it dynamic and simple to use.

(The demo also demonstrates the whole potential of doing too much and drowning yourself in flash -- notice how DNA letter codes are added, then promptly disappear in a black-on-black clash and are forgotten about.)

Ah, funny, I had not noticed that... Well, don't count on me to re-record the video just for that ;-)

But the worst part is the way these rotations and coloring statements create a hidden state that affects things below in an opaque manner...

Can you cite an example of a drawing API or language that has no opaque drawing state? Windows GDI, Cocoa, OpenGL or X-Window have a drawing context. The more advanced ones have a current drawing context, because passing a hDC to every single function adds strictly zero value to the code...

and I'm not even sure it might not effect stuff above it.

It doesn't (except if there's a funny bug somewhere). Why would you even imagine that?

There's a remarkable similarity between everything I've just said and the criticisms I've read of processing/processing.js (eg Bret Victor's opinions on Khan Academy's coding tutorials [worrydream.com]), so I'm guessing this was very heavily inspired by Processing's 2D canvasses....

The problem I have with the article you linked (which is very interesting, by the way) is that it only focuses on learning something, not on actually using it. Let me just give an example. The article asks (rhetorically):

That UI is exactly as informative as this line of code:
ellipse 202, 208, 300, 300
Why do we consider the code acceptable and the UI not? Why do we expect programmers to "look up" functions in "documentation", while modern user interfaces are designed so that documentation is typically unnecessary?

The reason is simple: the first time I learn about an ellipse, I might prefer
ellipse
        horizontal_position_of_center_in_pixels 202
        vertical_position_of_center_in_pixel 208
        width_in_pixels 300
        heigh_in_pixels 300

But if now I have a small example with 4 shapes like this, I go crazy at the third one. Even more so if all graphic shapes have the same parameters in the same order, i.e. always X, Y, W, H. As is the case in Tao3D.

It's OK for a user interface to put explicit labels on dialog boxes because I don't have to type them every single time I use the f...g dialog box...

So why do we use a keyboard to enter programs? Because it's the fastest way we have found so far. There are graphical programming languages, but they are restricted to toy experiments. As long as we have to type programs in, we might as well type as little as necessary...

Comment Re:Grammar ? (Score 1) 158

Suddenly you have to look in dozens of different places to verify what the most basic features of the language are.

Not really. The parsing is defined by xl.syntax, a file that currently contains 62 lines, so it's not complicated. The semantics, on the other hand, comes from libraries, including some that are built-in. In the case of base XL, the library components implemented in XL are in builtin.xl, and the components implemented in C++ are in basics.tbl.

But XL and Tao3D put way more in libraries than regular languages. Remember when we moved from BASIC to C? In BASIC, the 'PRINT' statement was a keyword. In C, 'printf' was a library routine. I argue that the C approach is superior. So of course, an exhaustive catalog of C libraries today is a bit difficult. And there are inconsistencies. But it's still superior.

Lisp has a tiny grammar and a small standard, and that leaves us buggering about with a visual confusion of brackets and parentheses.

And XL as a grammar that is just a little bit less tiny, just enough so that you can get rid of the parentheses.

if the basic behaviour of the language is overridable at will, then it is not consistent from day to day, or from job to job.

That's already the case in any language today that has libraries provided by more than one person. Where is the consistency between C's printf, C++'s iostream and Qt's logging facilities?

XL helps you create new notations that are well suited to the task at hand. It does help you make these notations consistent or useful, not any more than a C compiler makes the name of your C functions consistent or useful.

Why on Earth is anyone going to want to override operator precedence for making a presentation?

Because it lets me define operators such as * ** and *** for bullet points, for example, so now I can write slides like this:


slide "Example",
      * "First level bullet"
      ** "Second level bullet"

There are more interesting things you can do with custom notations. Here is an example using the Animate module:


import Slides
import Animate

picture_slide "Page 1",
        page_duration 10
        [0..3, ]
                color "red"
                circle 300 * smooth_ratio, 100, 20
        [0..3, ]
                color "blue"
                circle 300 * ratio, 0, 20

        [0..6, 9..10]
                color "green"
                circle 300 * down_ratio, 0, 20

        mouse_x in [0..1000]
                color "pink", 0.3
                rotate_z 90 * ratio
                rectangle 0, 0, 300, 200

picture_slide "Page 2",
        page_duration 2, "Page 1"
        story
                text "We'll return to page 1 shortly"

Once you have learned that Animate gives you a notation [A..B] to indicate when to do something, that the notation X in [A..B] is the same thing with arbitrary values (not just the page time), and that there are variants such as [A..B, C..D] for back-and-forth motion, it becomes really useful, easy to read and quick to write. I can't voucher for your capability to remember this notation, but it turns out this one I did not invent, yet I use it regularly.

That's technically possible with any language

No. The parse tree of most languages can't be shown in such a simple form. In some cases (C++ comes to mind), you can't even parse without a good deal of semantic analysis.

I'd like to see your response to that.

Will do.

Comment Re:Point? (Score 1) 158

For the algorithms, I'll let you look at the code :-) It's mostly in path3d.cpp, text_drawing.cpp and glyph_cache.cpp.

There are several algorithms that are activated separately depending on: whether you draw flat text or extruded 3D text; whether there's a texture or not; the size of the font; and more. The primary ones are: render to textures and draw quads, render polygons for the outline and play that back, or extrude the outline with triangle strips. Then there are some tricks to minimize the number of triangles emitted. I also tried an approach where we rendered triangles and there was a fragment shader doing the bezier curve inside each triangle. That was surprisingly very inefficient on many low-end graphic cards, so I stashed it without going through with it.

That being said, if you want the text to look any good, you have to emit a large number of triangles for even relatively simple text. The text of the previous paragraph is 69475 triangles in Arial, 138950 when extruded, 171298 polygons in font "Amaze" not even extruded, 265636 with the font "Be safe", 561930 with font IthornÎt, and ... a whopping 2171202 with Apple's "Chalkduster" font.

That still doesn't answer my question about what you think is lacking in WebGL.

1. Performance (which is getting good on desktop-class devices thanks to improvements in Javascript compilation, but still terrible e.g. on mobile devices).
2. Portability. I gave as an example the fact that using a mere GLSL shader as a background on my tutorial page made it unusable for a good fraction of the readers.
3. At the time we started, Microsoft still had the position that they would never support it. They changed their mind only last year, remember? So anybody using IE before 11 has no WebGL.

Comment Re:Grammar ? (Score 1) 158

Except when it doesn't just work and you have to debug, because then what you describe as "dynamic" starts to feel like "unpredictable" and it takes far longer to work through than it should. I've only looked at a very small example, but I cannot imagine myself ever trying to teach how to program in this language. How do you teach someone to think like something with very little internal logic or consistency?

The fact that its grammar cannot be expressed as EBNF (like Ada) does not mean that it's not precise and consistent. You look at some input and at the xl.syntax file, and you know exactly what parse tree you are getting out of that input. You look at the various rewrite rules (the things given by the rewrite operator -> and you know exactly what's going to be executed and why.

Overall, the grammar is much more consistent than most other languages, if only because it's so small. As I indicated elsewhere in this discussion, scanner and parser together represent some 1500 lines of C++ code, and a syntax file that is currently 62 lines long. A complete and precise description of the core language in plain english takes about 50 pages. Compare that to the 700 pages for the C++ standard, and tell me which one is easier to teach?

If you want to look at your input in a Lisp-ish syntax, you can, there's an option in the compiler to dump the parse tree in such a format. If you build the command-line compiler for XLR, it will be xlr -parse file.xl -style debug -show. You can also try -style dbghtml to see it create HTML coloured boxes corresponding to the program structure. For example, if you have the default syntax file, input http://pastebin.com/TTbCKshW turns into http://pastebin.com/wxZX2Fc0. It's absolutely deterministic.

The additional grammar rules I mentioned earlier, e.g. the distinction between statement and expression, are there to match the way we humans read code. That's what concept programming is about.

Comment Re:Smalltalk made new keyword creation easy in 198 (Score 1) 158

So does this mean that Tao3D is call-by-value by default, and this explicitly breaks it to (effectively) call-by-value, rather than leaving the programmer to hack around with statics or constants and individual copies of arguments?

The locally function is conceptually equivalent to running its argument surrounding it with graphics state save/restore code. That's about it. So you can't deduce anything about call-by-value from it.

Now, to address your question in short, XL uses call-by-reference, and lazily evaluates the arguments as required to perform the call. Cases where you need to evaluate include: having to check against a type that is not "tree", comparing against a pattern, comparing for identity between arguments. For more details, see section 3.3. "Evaluation" of https://raw.githubusercontent..... You can also explicitly evaluate something with 'do'. In the 'if-then-else' definition given elsewhere, there is a 'do' for the bodies, to force evaluation of only that argument to if-then-else corresponding to the condition. If the condition is true, you only evaluate the true clause. If it's false, you only evaluate the false clause.

Comment Re:Smalltalk made new keyword creation easy in 198 (Score 1) 158

Semantic whitespace makes me sad. :-(

Maybe you never had to work in a large project where the project most productive guy did no care about indentation at all. Whitespace has a semantics for our brain, so we might as well make that consistent with the code. It reduces syntactic noise, in concept programming jargon.

Slashdot Top Deals

Math is like love -- a simple idea but it can get complicated. -- R. Drabek

Working...