1. Missing features in Euphoria
- Posted by GreenEuphorian Jul 28, 2014
- 1867 views
- Last edited Jan 25, 2015
From my point of view, Euphoria is more-or-less missing only two features - native multithread support and generators. (I'm still working on the first but not making a lot of progress yet.) Otherwise, it mostly has everything you'd expect from another language.
I was quite surprised to read your statement, Jim. Do you really mean that in your opinion the future development of the language should be limited to these two features?
Reading the old posts on the forum I have come across many comments pointing out how Euphoria is actually lacking in many areas, not just the two that you mentioned. Of course, the development team is small and the progress is slow, but why restrict the possibilities for development? Also, I believe it is always better to be realistic, and keep in view the weaknesses of the language, for the sake of improvement.
I have compiled (from many forum posts) a tentative list of the many missing features requested by Euphoria's users over the years, which (I hope) summarizes the main points on which the developers may want to concentrate for future development.
Disclaimer: some of these issues might already have been solved in the latest releases of the language, with which I am not very familiar. If an issue has already been solved, kindly point it out.
- Lack of structures
- Lack of OOP
- Lack of error/exception handling
- Lack of closures
- Lack of threads
- Lack of higher-order functions
- Lack of support for embedding
- Lack of native Unicode support
- Lack of generators
- Lack of efficient disk space management (to avoid waste of disk space when writing data files)
- Lack of true random access for files
- Lack of reference semantics
- Lack of scalar accumulation along a vector operator
- Lack of run-time function specifier
- Lack of pointers
- Lack of nested functions
- Lack of REPL
- Lack of eval ()
- Lack of reflection
- Lack of run-time dynamism, i.e. not being able to interpret or evaluate code at run-time
Now, before someone starts shouting at me that Euphoria is not meant to become another C plus plus or the like, trying to incorporate all the possible language features in the world, I clarify that I am NOT advocating that all these features should be implemented in Euphoria. I am merely pointing out that these features (some of which may indeed be useless or redundant) are not present in Euphoria. At the same time, I am sure that many users would really appreciate if some of these features were added to the language.
Could some of the developers please take the time to comment on the features listed above, just to give the users an idea of what they should or should not expect in future releases? It would be nice if a priority marker was specified against each feature (e.g. high, medium, low, nil) so that the expectations of the users can at least be redefined in more realistic terms.
It would also be useful if non-developers also commented on the desirability of these features, from their respective points of view.
Thanks
Green Euphorian
2. Re: Missing features in Euphoria
- Posted by tbohon Jul 28, 2014
- 1789 views
My 2c worth (and this comment is worth exactly what you're paying for it so keep that in mind ... :) )
Of the list presented the only two that I personally would like to have are the structures and the random file access additions. The others, while nice and perhaps needed by some developers, are 'fluff' IMO. Sure Euphoria could become another C# with incomprehensible syntax, 2-line long function/subroutine calls and obtuse syntactical twists depending on the time of day/day of week when the code was written ... but is that what we want and above all is it wise? Living in a Micro$oft developer world every single day at work I really enjoy going home and figuring out how to do what I need to do in Euphoria.
So, bottom line: I like Euphoria just as it is, frankly ... in fact version 4.x is going to be the ONLY programming language on the Linux box that I'm currently building. The addition of all the other 'stuff' listed won't enhance my personal experience in any way ... in fact it will make me dread doing any serious coding in Euphoria.
Again, before I get slammed, this is my personal opinion and represents my thoughts on the list given earlier ...
Have a great day!
Tom
3. Re: Missing features in Euphoria
- Posted by jimcbrown (admin) Jul 28, 2014
- 1895 views
From my point of view, Euphoria is more-or-less missing only two features - native multithread support and generators. (I'm still working on the first but not making a lot of progress yet.) Otherwise, it mostly has everything you'd expect from another language.
I was quite surprised to read your statement, Jim. Do you really mean that in your opinion the future development of the language should be limited to these two features?
Of course, the development team is small and the progress is slow, but why restrict the possibilities for development?
Of course not. Just that those are the major two that can't be implemented outside of the language. I'll concede a point though - I forgot about exception handling. That's a third.
But, if someone wants to have a go (or another go) at implementing feature XYZ in Euphoria itself, I'm all for it.
Reading the old posts on the forum I have come across many comments pointing out how Euphoria is actually lacking in many areas, not just the two that you mentioned.
I think this is best addressed by directly addressing each area you have brought up from your compiled list.
Disclaimer: some of these issues might already have been solved in the latest releases of the language, with which I am not very familiar. If an issue has already been solved, kindly point it out.
- Lack of structures
memtructs branch.
- Lack of OOP
A standard dot4 preprocessor (which gives OOP sugar syntax) is included in demos iirc. We also have OOP libraries (like Diamond).
- Lack of error/exception handling
Conceded.
- Lack of threads
I already mentioned this, but yes.
- Lack of generators
Ditto.
- Lack of run-time function specifier
Maybe I'm misunderstanding here, but isn't this just routine_id?
- Lack of closures
This can be done with delete_routine. Perhaps though we're better off adding closures proper (with all the syntax sugar).
- Lack of native Unicode support
True. Actually however, a large part of this was already implemented - but the dev team made a choice to push this back until a much later release. I don't consider this a big deal because most UI toolkits provide unicode support anyways, and I've been using UTF-8 with Euphoria for years.
- Lack of higher-order functions
Hmm... maybe, I suppose... I've written function composition libraries for Euphoria before....
- Lack of support for embedding
True. The current C-based source code is not easy to use for embedding Euphoria into another program. Of course, you could always turn something like Matt's eueval library into a shared library, but this isn't the most efficient way of doing things.
- Lack of efficient disk space management (to avoid waste of disk space when writing data files)
What exactly are you referring to with this? Something like bget() ?
- Lack of true random access for files
You can do it if the operating system supports it, you just might need to wrap a library or two.
- Lack of scalar accumulation along a vector operator
You mean something like a generic version of sum() or or_all() ?
You're right, we seem to lack this. The closet thing we have to a generic version of this seems to be stdseq:apply()
- Lack of pointers
I wrote a preprocessor to simulate these, and something similar exists today in the stdlib as eumem. Actually, however, there's a way to get real pointers to work.
- Lack of reference semantics
Conceded. Having pointers is probably good enough, but getting the syntax sugar and the real sematics would be nice.
- Lack of nested functions
Agreed, but this is easy to emulate with a preprocessor.
- Lack of REPL
True. There was a REPL at one point in time, but it no longer works with current versions of Euphoria.
- Lack of eval ()
True, but one can get it to work by including eu.ex - Matt once wrote an eueval library to do this.
- Lack of reflection
Conceded. This won't be universally possible. Translated programs won't be able to support reflection, ever. The interpreter could in theory, but it'd take a lot of work on the insides.
- Lack of run-time dynamism, i.e. not being able to interpret or evaluate code at run-time
Hmm. Actually the interpreter can already do this in theory, but no one has ever attempted to make it do this. Anyways, you can simulate this with eu.ex or Mat''s eueval library.
Now, before someone starts shouting at me that Euphoria is not meant to become another C plus plus or the like, trying to incorporate all the possible language features in the world, I clarify that I am NOT advocating that all these features should be implemented in Euphoria. I am merely pointing out that these features (some of which may indeed be useless or redundant) are not present in Euphoria. At the same time, I am sure that many users would really appreciate if some of these features were added to the language.
Absolutely. There's nothing wrong with holding a discussion.
My main point though, is that the lack of, e.g. nested functions or OOP or REPL or reflection or embeddability in (for example) C does not make C a toy language.
Also, I believe it is always better to be realistic, and keep in view the weaknesses of the language, for the sake of improvement.
This I agree with in its entirety.
4. Re: Missing features in Euphoria
- Posted by mattlewis (admin) Jul 28, 2014
- 1750 views
- Lack of reflection
Conceded. This won't be universally possible. Translated programs won't be able to support reflection, ever. The interpreter could in theory, but it'd take a lot of work on the insides.
I think a lot of the work has already been done in the interpreter. Take a look at the debugger stuff. I think it could be done with the translator. Probably similar to how we work with routine ids now.
Matt
5. Re: Missing features in Euphoria
- Posted by ghaberek (admin) Jul 28, 2014
- 1739 views
- Lack of OOP
A standard dot4 preprocessor (which gives OOP sugar syntax) is included in demos iirc. We also have OOP libraries (like Diamond).
On that note, I'd also like to point out that Euphoria's preprocessor system leaves a lot to be desired. Without a reliable means of chewing up the language and spitting it back out, every preprocessor author is left to his own devices. The barrier-of-entry on implementing new preprocessor-defined features shouldn't be so high. There's got to be a more formalized way to process the language.
-Greg
6. Re: Missing features in Euphoria
- Posted by DerekParnell (admin) Jul 29, 2014
- 1706 views
I think that we need to be a bit more precise with the terminology that is used during this discussion. We could end up arguing about different things without realizing it.
When changing Euphoria in significant ways, we have to be certain that there is a justifiable need. A strong case in favor of the change needs to be ratified by the community.
But anyhow, here are my initial thoughts on this list.
- Lack of structures
- Data structures are those that allow us to name, assign datatypes to, and refer to, items in a sequence. Used within a Euphoria coded program.
- Memory-mapped structures are those that allow us to name, assign datatypes to, and refer to, areas of RAM. Used when interfacing with other languages.
- Lack of OOP
- Lack of error/exception handling
- Lack of closures
- Lack of threads
- Lack of higher-order functions
- Lack of native Unicode support
- Lack of efficient disk space management (to avoid waste of disk space when writing data files)
- Lack of true random access for files
- Lack of reference semantics
- Lack of pointers
- Lack of scalar accumulation along a vector operator
- Lack of run-time function specifier
- Lack of nested functions
- Lack of reflection
- Lack of REPL
- Lack of eval ()
- Lack of run-time dynamism, i.e. not being able to interpret or evaluate code at run-time
7. Re: Missing features in Euphoria
- Posted by ghaberek (admin) Jul 29, 2014
- 1635 views
- Lack of reflection
I'll quote myself on that one:
- Lack of OOP
A standard dot4 preprocessor (which gives OOP sugar syntax) is included in demos iirc. We also have OOP libraries (like Diamond).
On that note, I'd also like to point out that Euphoria's preprocessor system leaves a lot to be desired. Without a reliable means of chewing up the language and spitting it back out, every preprocessor author is left to his own devices. The barrier-of-entry on implementing new preprocessor-defined features shouldn't be so high. There's got to be a more formalized way to process the language.
I guess what I was really referring to here was reflection. It really seems that the two go hand-in-hand: implementing reflection without OOP seems unnecessary and implementing OOP without reflection seems incomplete.
-Greg
8. Re: Missing features in Euphoria
- Posted by mattlewis (admin) Jul 29, 2014
- 1634 views
- Lack of reference semantics
- Lack of pointers
I'm not totally convinced that the pros outweigh the cons for this. But note that using std/eumem.e /is/ using pointers to a heap stored in a sequence, along with all of the problems that come with "normal" pointers. To me, the best argument for native reference semantics (vs eumem) is performance. There are some hacky workarounds to get good performance when modifying data stored in eumem.
Also, the existence of our delete routine stuff could make debugging a lot easier. IOW, we already have hooks for when euphoria objects are dereferenced, and we could (optionally) supply a default hook to track this sort of thing, say when with debug is in effect. We could do additional instrumentation / logging to produce something similar to what valgrind gives to C/C++.
Matt
9. Re: Missing features in Euphoria
- Posted by Nevla Aug 09, 2014
- 1473 views
- Last edited Aug 10, 2014
- Lack of higher-order functions
If we had anonymous functions, we could implement a truly Euphoric OOP system by using sequences (yes, sequences!), without the need for any other OOP infrastructure. And it would be an all-Euphoric solution, for Euphoria purists.
That's what Lua developers did with tables, which are to Lua what sequences are to Euphoria. The clever trick by Lua's developers consisted in having OOP objects that are actually tables. The methods/functions are stored within the tables, just like the variables are. Everything in Lua is table-based, so objects are simply tables. Of course, there is some syntax candy involved to make them look like traditional objects, but in the end they are nothing but tables. Why can't we have the same in Euphoria, with sequences?
- Lack of nested functions
+1
I would really like to see nested functions supported in Euphoria.
10. Re: Missing features in Euphoria
- Posted by DerekParnell (admin) Aug 10, 2014
- 1371 views
If we had anonymous functions, we could implement a truly Euphoric OOP system by using sequences (yes, sequences!), without the need for any other OOP infrastructure. And it would be an all-Euphoric solution, for Euphoria purists.
...
Why can't we have the same in Euphoria, with sequences?
This is already possible in Euphoria and has already been used by a few OO systems written in Euphoria. Check out the routine_id function.
The issue is really that Euphoria doesn't have the syntax niceties to make it easier to write and read OO code.
The first C++ 'compiler' was actually just a front end processor that output standard C code, which was feed into the normal C compiler to produce the runtime program.
11. Re: Missing features in Euphoria
- Posted by Nevla Aug 10, 2014
- 1359 views
If we had anonymous functions, we could implement a truly Euphoric OOP system by using sequences (yes, sequences!), without the need for any other OOP infrastructure. And it would be an all-Euphoric solution, for Euphoria purists.
...
Why can't we have the same in Euphoria, with sequences?
This is already possible in Euphoria and has already been used by a few OO systems written in Euphoria. Check out the routine_id function.
I see. Is there an easy-to-read article somewhere that compares the different OO systems for Euphoria? Possibly with a comparative table showing the different syntax conventions.
12. Re: Missing features in Euphoria
- Posted by DerekParnell (admin) Aug 10, 2014
- 1355 views
I see. Is there an easy-to-read article somewhere that compares the different OO systems for Euphoria? Possibly with a comparative table showing the different syntax conventions.
No. You'll need to do the research yourself at this stage.