VietTUG.org - old forum - threads' archive

thread_id = 2384, contains 2384
id = 2384, parent = 0, thread = 2384, catid = 17, locked = 0, moved = 0,
userid = longgia2001, ip = 218.56.32.230, time = 2006/06/15 (1150376261) ,
subject = Eukleides 1.5 Nhiều cải tiến đáng iêu !!!, hits = 521, karma = 0+0-,
URL: http://www.eukleides.org

Ngôn ngữ vẽ hình hình học Ơ-cờ-lít đã có bản thử nghiệm, phiên bản 1.5.

Nhiều cải tiến đáng kể ...

Ngôn ngữ lập trình sáng sủa, và cũng lạnh lùng hơn ...



Dưới đây là trích dẫn nhuyên ven của Tác giả Christian

Ghi chú
Trích dẫn
Dear Eukleides friends,

I fairly think Eukleides 1.0 is quite an efficient language for creating
geometric figures. Nevertheless, I'm not satisfied with it because its
implementation makes it really difficult to extend. That's why I started
last year to rewrite it from scratch, adding by the way all the
features I found desirable. I'm now done with the first step, a virtual
machine based interpreter which I'll try to describe a bit:

* Direct PostScript output.

Unlike the former version, `eukleides' doesn't use PSTricks anymore.
It is meant to directly produce EPS figures, not to preprocess
(La)TeX files. Another program named `euktopst' will care for that.

* Dynamically loaded keywords.

I used the `gettext' system, so one just has to create a PO file to
add a localized version. I've done a French one as an example. (To
get a template, run `make pot' in the `po/' directory of the
distribution.)

* Loops, tests, user-defined functions and commands, basic I/O.

Eukleides can now be considered a real programming language.

* Include files.

Which allows to write ones own libraries.

* Ordered sets of points to handle polygons and loci.

With the former version, it was only possible to draw a locus (using
the `trace' command). Now loci are like any other geometrical
object and can be used the same way.

* Better language design (well... at least I hope so .

With Eukleides 1.0, command's arguments must be enclosed in round
braces like function's arguments. In fact this is useless since
commands do not return a value, so I decided to suppress that.

A Eukleides 1.0 script usually contains a lot of `draw' commands
which seems to me rather inelegant. Now to draw several objects one
just has to list them in a ``drawing block'', that is a sequence of
lines starting with `draw' and ending with `end'.

Interactive variable did not satisfy me either, so:
x interactive(0,.1,"A",right)
is now written:
horizontal x(#A,.1) = 0
Furthermore, interactive variable are often used to define mobile
points:
xa interactive(0,.2,"A",right)
ya interactive(0,.2,"A",up)
A = point(xa,ya)
Now, one just have to write:
mobile A(.2) = point(0,0)
Since the point's name is A, the interpreter assumes it is linked to
the #A state (but of course, one can give a different state argument
if needed).

The snapshot feature will also be different with `gEukleides' (which
is going to replace `xeukleides'). It will be based on ``init
directives'', that is a line starting with a sharp sign like:
# A -10 a 5 b -15
which means to interpret the figure as if the down arrow key would
have been hit 10 times in #A state, the right arrow key 5 times in #A
state and the left arrow key 15 times in #B state.

Since only the first encountered init directive is used, `gEukleides'
will only have to add such a line at top of the edited script to take
a snapshot. I admit these directives may be a bit difficult to read
but they'll allow to keep track of several snapshots.

Init directives are also implemented in `eukleides', you can even use
one as a command line option.

* Animated output (ImageMagick required).

Using an interactive variable together with the `--animate' command
line option allows to produce a multi-page PS document which can be
easily converted into an animated GIF or MNG file.

Except a few other slight differences, the remaining is quite identical
to Eukleides 1.0. Since it is a complete rewrite, I carefully tested
every piece of code but there's probably a ton of bugs left. And I did
not yet write any documentation.

Anyway, I decided to make a private prerelease for people I think could
be interested. You can download it at:

<http://www.eukleides.org/download/eukleides-1.5.0pre3.tar.bz2>

and play with it if you want . I wrote a set of scripts to illustrate
all the changes and the new features, and put it in the `bin/' directory
of the distribution.

I now plan to:

* Step 2: Implement `euktopst'.

* Step 3: Implement `gEukleides' using GTK+ 2 and GtkSourceView. I'll
add features like printing, conversion to EPS and other formats.

* Step 4: Write the documentation (I think I'm still going to use
Texinfo) and make the first public release.

* Step 5: Sleep :-D

* Step 6: Clean the code and comment it a bit. Write some Eukleides
configuration files for VIM and maybe Emacs.

Christian Obrecht