PDA

View Full Version : Euphoria has gone open source


Mentat
11-08-2006, 12:27 PM
Just curious if there are any Euphorians on this board. I am a huge fan of the language, and Euphoria has just gone open source.

I highly recommend you check it out if you haven't already. It's perfect for many types of programs. While interpreted, it is very fast (MUCH faster than Perl or Python), and it even comes with a Euphoria To C translator for added speed.

www.rapideuphoria.com

Here's a description taken from the site:

"Euphoria is a very-high-level programming language with several features that set it apart from the crowd:


Euphoria programs run on Windows, DOS, Linux, and FreeBSD.

Euphoria is free and open source. The complete source code for the Euphoria interpreter, translator and binder is included in the download package.

The language is flexible, powerful, and easy to learn.

There is no waiting for compiles and links - just edit and run.

You can create and distribute a royalty-free, stand-alone .exe file.

Dynamic storage allocation is fundamental to Euphoria. Variables grow or shrink in size without the programmer having to worry about allocating and freeing chunks of memory. Elements of an array (Euphoria sequence) can be a dynamic mixture of different types and sizes of data.

Euphoria provides extensive run-time error checking for: out-of-bounds subscripts, uninitialized variables, bad parameter values for library routines, illegal value assigned to a variable, and many more. If something goes wrong you'll get a full error message, with a call traceback and a listing of variable values. With other languages you'll typically get protection faults with useless dumps of machine registers and addresses.

The Euphoria interpreter is more than 30 times faster than either Perl or Python, and it's considerably faster than all other interpreted languages, according to the "Great Computer Language Shootout" benchmark (see demo\bench\bench.doc).

If that isn't enough, there's a Euphoria To C Translator that can translate any Euphoria program to C, and boost your speed even more. Why waste time debugging hand-coded C/C++? You can easily develop a Euphoria program, and then generate the C code.

Euphoria programs are not constrained by any 640K memory restrictions for which MS-DOS is infamous. All versions of Euphoria let you use all the memory on your system, and if that isn't enough, a swap file on disk will provide additional virtual memory.

An integrated, easy-to-use, full-screen source-level debugger/tracer is included.

Both an execution-count profiler, and a time profiler are available.

There is a large and rapidly growing collection of excellent 3rd party programs and libraries, most with full source code.

RDS has developed an extremely flexible database system (EDS) that is portable across all Euphoria platforms.

The WIN32 implementation of Euphoria can access any WIN32 API routine, as well as C or Euphoria routines in .DLL files. A team of people has developed a Windows GUI library (Win32Lib), complete with a powerful Interactive Development Environment. You can design a user interface graphically, specify the Euphoria statements to be executed when someone clicks, and the IDE will create a complete Euphoria program for you. There are Windows Euphoria libraries for Internet access, 3-D games, and many other application areas.

The DOS32 implementation of Euphoria on MS-DOS contains a built-in graphics library. If necessary, you can access DOS software interrupts. You can call machine-code routines. You can even set up your own hardware interrupt handlers. Many high-speed action games, complete with Sound Blaster sound effects, have been developed 100% in Euphoria, without the need for any machine code.

The Linux and FreeBSD implementations of Euphoria let you access C routines and variables in shared libraries, for tasks ranging from graphics, to X windows GUI programming, to Internet CGI programming. The good news is, you'll be programming in Euphoria, not C."

esrix
11-08-2006, 06:10 PM
I suppose the real issue I had with Euphoria was that it isn't object oriented, although you can fake it since arrays can hold various types of objects.

That and I was hoping for a Mac port one day.

Maybe this will change now :)

Pallav Nawani
11-08-2006, 08:46 PM
When you install python, you also get standard facilities for walking a directory tree, making a tarball etc. Does euphoria standard install also include such facilities?

Bad Sector
11-09-2006, 01:12 AM
Nice, i'll check it out. I like learning new languages :-).

The syntax looks alot like "New" BASIC (that is, no 10, 20, 30 but QBasic-like stuff).

Mentat
11-09-2006, 07:55 AM
I suppose the real issue I had with Euphoria was that it isn't object oriented, although you can fake it since arrays can hold various types of objects.

That and I was hoping for a Mac port one day.

Maybe this will change now :)

Several users have written OOP libraries for Euphoria, so you're in luck. The site has a large archive with tons of useful programs / libraries that users have written. You can browse the archive here:

http://www.rapideuphoria.com/archive.htm

I have heard word of someone working on a Mac port, but haven't seen anything concrete yet.

HairyTroll
11-09-2006, 08:10 AM
The sorting example (http://www.rapideuphoria.com/refman_1.htm#1) written in Lisp is a little shorter:

(sort '(9 10 3 1 4 5 8 7 6 2) #'<)

Mentat
11-09-2006, 08:15 AM
When you install python, you also get standard facilities for walking a directory tree, making a tarball etc. Does euphoria standard install also include such facilities?

There are several functions that come with the base Euphoria install, including functions to walk a directory tree (surprisingly, it's called walk_dir()). Also comes with a binder to make stand-alone exes, and a translator if you'd rather compile your program in C.

You can browse the complete documentation online if you'd like:

http://www.rapideuphoria.com/refman.htm

The latest version added multitasking, which is nice (from the manual):

"This collection of routines lets you create multiple, independent tasks. Each task has its own current statement being executed, its own subroutine call stack, and its own set of private variables. The local and global variables of a program are shared amongst all tasks. When a task calls task_yield(), it is suspended, and the Euphoria scheduler decides which task to execute next."

Mentat
11-09-2006, 08:21 AM
The sorting example (http://www.rapideuphoria.com/refman_1.htm#1) written in Lisp is a little shorter:

(sort '(9 10 3 1 4 5 8 7 6 2) #'<)

True, but merge_sort() will just as easily sort {1.5, -9, 1e6, 100} or {"oranges", "apples", "bananas"}. Sequences are what make Euphoria so powerful. You can store and perform operations on any data type, even mixed types, without changing the function.

HairyTroll
11-09-2006, 08:31 AM
True, but merge_sort() will just as easily sort {1.5, -9, 1e6, 100} or {"oranges", "apples", "bananas"}. Sequences are what make Euphoria so powerful. You can store and perform operations on any data type, even mixed types, without changing the function.

That's a no brainer:

(sort '(1.5 9 1e6 100) #'<)

(sort '("oranges", "apples", "bananas") #'string-lessp)

How will merge_sort sort structures? Or a sequence of sequences?
What if you wanted to sort in decending order instead of ascending order? Do you have to write a new merge_sort? In Lisp:

(sort '(1.5 9 1e6 100) #'>)

(sort '("oranges", "apples", "bananas") #'string-morep)

HairyTroll
11-09-2006, 08:53 AM
Sequences are what make Euphoria so powerful. You can store and perform operations on any data type, even mixed types, without changing the function.

This statement is like waving a red flag in front of any Schemer or Lisper.

For example, can Euphorian hold code in a sequence?

Mentat
11-09-2006, 09:05 AM
How will merge_sort sort structures? Or a sequence of sequences?
What if you wanted to sort in decending order instead of ascending order? Do you have to write a new merge_sort?

Structures are not part of base Euphoria, although you can easily simulate structures with sequences, and you can nest sequences infinitely (limited only by memory). So sequences of sequences are perfectly acceptable. By default, Euphoria sorts in ascending order. However, you can simply call the reverse() function after you sort to reverse the order of the entire sequence.

Mentat
11-09-2006, 09:12 AM
This statement is like waving a red flag in front of any Schemer or Lisper.

For example, can Euphorian hold code in a sequence?

Yep. It can hold expressions or even call functions. For example, this is a perfectly legal sequence:

{"Hello", x+6, 9, y*w+2, sin(0.5)}

They are evaluated at runtime.

HairyTroll
11-09-2006, 09:19 AM
Yep. It can hold expressions or even call functions. For example, this is a perfectly legal sequence:

{"Hello", x+6, 9, y*w+2, sin(0.5)}

They are evaluated at runtime.

Well that bumps it up a notch.

esrix
11-09-2006, 10:15 AM
Several users have written OOP libraries for Euphoria, so you're in luck. The site has a large archive with tons of useful programs / libraries that users have written. You can browse the archive here:

http://www.rapideuphoria.com/archive.htm

I have heard word of someone working on a Mac port, but haven't seen anything concrete yet.

Sounds nifty. I'll check it out.