Re: Promote Euphoria - MAKE A PAGE ON WIKIPEDIA

new topic     » goto parent     » topic index » view thread      » older message » newer message

A team that's motivated to contribute to a language should have a vision to what Euphoria is. What might be a good change for one developer would be a regression for another. Motivated developers need to first agree with a list of features. Then they can work as a team toward that goal. For me prior to Euphoria 4.0, EUPHORIA had always been and mostly still is:

  • always well defined behavior. You'll wont find the phrase "undefined behavior" for anything apart from interfaces to machine language or C function calls.
  • No special rules for differing number types. The 2.5 * 2 is identical to the integer 5.
  • declare before use.
  • a minimalist built-in declared type-system.
  • types defined by run-time functions rather than declarative statements.
  • pass-by-value semantics. (References are used internally but that is an implementation detail.)
  • strict checking everywhere. Never should there ever be a crash without an ex.err file generated. Although not possible for calling C or machine code.
  • words rather than punctuation
  • no need for pointers and no pointers.
  • characters are not length 1 strings.
  • really good explanations for errors

Euphoria 4.1 brought us many flow control statements and other statements (most notably enum) that improves the user experience, but it also broke some of these things above.

There are some routines in the standard library which work around not having pointers. Imagine having to assign a map value to itself when you did a map put:

Instead of pass by value semantics like this

include std/map.e as map 
map:map p = map:new() 
p = map:put(p, 2, "two") 
p = map:put(p, 3, "three") 
p = map:put(p, 5, "five") 

We instead only need to type:

include std/map.e as map 
map:map p = map:new() 
map:put(p, 2, "two") 
map:put(p, 3, "three") 
map:put(p, 5, "five") 

Now p is one level removed from the user. p is not a map it's a reference value to a map. The standard library added a reference system. Pointers were not added to the language but added to a library. This breaks the slogan, Euphoria doesn't need pointers. Also, the user can't just save p to a file as if it's a EUPHORIA object with the data in it.

The way map works and a couple of others goes against the ethic that Euphoria doesn't need pointers. It turns out there are certain algorithms that need pointers. There are some involving binary trees. Though p is not a pointer, the value p is a handle like object. It is like something you would get from open(), yet it is a handle to data in your program rather than to a file. To me, this kind of thing is inconsistent with the way Euphoria was supposed to be. Yet at the same time I am thankful that I don't need to make assignment statements for each call.

Now ifdef is a regression in my view, because it puts EUPHORIA to where C is in terms of safety. If the compile time value doesn't exist, then the code inside the block is not even parsed for mispelt variable names. The advantages for this is speed, but C compile optimization makes this moot. I can still sympathize with the other side, but I have never been convinced of this.

There were other changes that violated "strict checking everywhere" in allowing functions to be called as if they were procedures, and changes to the behavior or length, and object.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu