Euphoria & Data types - what's the big deal? (Code)

by shian ⌂ @, Israel, Friday, February 07, 2020, 19:53 (18 days ago) @ shian
edited by shian, Friday, February 07, 2020, 21:39

The computer's hardware has only one basic data type: integer.

integer can be made of 4-bits, 8-bits (bit is 0 or 1), 16-bits, 32-bits, 64-bits, 128-bits, etc.

Modern computers can take 64-bits integer or even longer integer and use one of its bits as a decimal point (simplified), therefore modern computers can deal with another data type: floating point.

OK, that's all you need to know: your computer has only two data types: integer and floating point (which is still an integer but is dealt differently by the CPU).


Any programming language is "faking" data types of many kinds: Boolean, String, Double, Single, Integer, Byte, Array, Dictionary, Complex Number, Date, Map, Tree, Currency, Vector, etc, etc, etc.

Well I said "faking", yea. All of these data types are not necessarily exist in your hardware, these are just software libraries that provide "new" data types. Well that's great :-P!! isn't it?

Isn't it great to have lots of data types for any purpose under the sun? Not really :-|.

A programming language that provides lots of data type - must provide lots of functions, methods, and all kinds of tricks which allow you to manipulate each individual data type. And I'm talking about LOTS of stuff. So that the programming language looks like a huge supermarket and you're supposed to remember where are your favorite things that you like to buy. That's not easy.

Now, instead of having to remember 30 different data types, and the functions that manipulate each one of them, like sort_integer(), sort_map(), sort_double(), etc - imagine that you could represent and manipulate all data types as just one data type... well this is what Euphoria does: it takes the only data types that your hardware knows, integer and floating point, and use them as integer and atom.

But how can Euphoria deal with a Vector, Array, Map, Single, Date, Boolean - and all that nonsense? In Euphoria we call that nonsense a flexible sequence. Which simply means that the sequence is flexible so you can use it in any way you want, period.


In Euphoria we don't need LOTS of functions to deal with each individual data type - we can have a single function, like sort(), that will sort anything (cats, dogs, letters, spaceships).

So Euphoria is unique, it has only two data types, atom and sequence, and another two data types just as helpers, integer and object: integer is a faster but limited atom; and object can be integer, atom or sequence - because, for example, our sort() function can sort anything and anything is simply called "object" (not to be confused with the "Object Oriented Programming" punishment).

OK - that's it. Go figure why programming languages are SOOOOOOO complicated!

That's why Euphoria is extremely simple and powerful; mainly because of the no-data-types concept. Still don't believe? download Euphoria and try it by yourself.

"Everyone knows the truth about himself, except the fool who considers himself wise". (

Complete thread:

 RSS Feed of thread

powered by my little forum