Page 1 of 2
New programming language
Posted: Wed Jul 30, 2014 5:33 am
by Bencz
Hi
Making a fork of
this topic, I want to show a new programming language... not so new, but, new, for windows....
ELENA is a general-purpose, full object-oriented, polymorphic language with late binding. It promotes more object-oriented program design, reusable and more standardized code.
The language features code mutation, ElenaScript, argument signatures and many others. It is under active development!
Features
[*]Pure polymorphic object oriented language
[*]Changeable object behavior
[*]Dynamic class mutation
[*]Command line 32-bit compiler
[*]GUI IDE & Debugger
[*]Unicode support
[*]Complete source code
[*]Getting started tutorial
[*]Simple Assembler compiler
[*]Multiple message dispatch
[*]Virtual Machine Terminal
[*]Dynamic Self-Assembling Script engine
You can download the compiler and source code in this link:
http://sourceforge.net/projects/elenalang/ .or. in this:
https://github.com/ELENA-LANG/elena-lang
Here a simple sample: ( hello world )
Code: Select all
// --- Program ---
#symbol Program =
[
system'console writeLine:"Hello World!!" readChar. // wait for any key
].
And a class sample ( Class to help in read and write a .INI file ):
Code: Select all
#class IniHelper
{
#field fileName.
#constructor new &FileName:cFileName
[
fileName := cFileName.
]
#method SetFileName : cFileName
[ fileName := cFileName. ]
#method IniReadValue §ion:cSection &key:cKey
[
#var retValue := LiteralValue new &length:255.
#var bufRet := Integer new.
bufRet << system'external'KERNEL32 GetPrivateProfileStringW
&literal:cSection
&literal:cKey
&literal:0
&out'literal:retValue
&int:255
&literal:fileName.
^(retValue delete &index:bufRet &length:(255-bufRet)).
]
#method IniWriteValue §ion:cSection &key:cKey &value:cValue
[
#var(type:int) lRet := system'external'KERNEL32 WritePrivateProfileStringW
&literal:cSection
&literal:cKey
&literal:cValue
&literal:fileName.
(0 == lRet)
? [ #throw Exception new:"Impossible to create the file". ].
]
}
Re: New programming language
Posted: Wed Jul 30, 2014 2:35 pm
by Nable
Hm... this style looks familiar. Ah, here it was:
https://en.wikipedia.org/wiki/Julia_language
Re: New programming language
Posted: Wed Jul 30, 2014 5:12 pm
by Bencz
Oh!!
haha,yes, really like... btw, Elena is based on SmallTalk!
Re: New programming language
Posted: Thu Aug 21, 2014 5:20 pm
by Wajideu
As much as I admire the fact that you were able to create your own programming language and write a compiler for it, this language just gives me a headache. Pointing out the problems I see with it:
- The use of hashtag symbols in declarations. There is no reason for these to be there. The keywords should already be reserved, so all it does is make the code illegible, and can be a source of confusion for people coming from C++ or Python backgrounds where it is used for comments or pragma directives
- The use of '.' to mark the end of lines of code. Yes, I understand there are languages that use this, but most of those languages have pretty much died. This would be a source of trouble for anyone coming from a background of most other modern languages where a semi-colon is pretty much the adopted standard and periods are used for referencing.
- Symbol declaration just looks ridiculous. Program = [ print "hello world" ]; wtf?! That makes no sense. Executable code shouldn't be treated like a variable.
- This:
Code: Select all
^(retValue delete &index:bufRet &length:(255-bufRet)).
Firstly, I'm not even sure if you're using the ampersand as some way of referencing the address of an object or if it's supposed to be an object prefix like $ in PHP because of how much it populates the code. Second, deleting something shouldn't return a value. Third, why are you using something like ^ to return a value from a function instead of using a keyword like "return"?
- Using ' for what I assume can only be either name-spacing or applying attributes is also ridiculously confusing. Why is it only used once in some areas and twice in others? Anyone coming from any other language would probably just stare at this for a few minutes drooling on their keyboard.
There are some decent ideas that I can see like using ":=" to assign variables instead of "=" which rids the confusion between "=" and "==" for beginners, and what appears to be the use of interfaces for methods, but for the most part it's an eyesore. While it is good to introduce new things, you must also take into consideration what most people are already familiar with.
It seems like you didn't put any time whatsoever into studying the pros and cons of various languages, reading a few articles or threads about programming language design theory to see what other features people might desire for in a language, nor taking a look at some statistics to get a general oversight on what people are most content with. If it's something you made specifically for yourself, then I guess the phrase is "whatever floats your boat...", but as it stands I cannot see any sane non-masochistic person who would look at these examples and say; "oh! I wanna learn that!".
Re: New programming language
Posted: Fri Aug 22, 2014 12:14 am
by iansjack
Most, if not all, of the features that you object to are taken from Smalltalk, which the OP said his language is based on. This is by no means an unknown, unused language. You might as well complain that:
[obect doSomething]
is not a good way to call a method because that's not the way that C++ does it.
I think your response demonstrates your unfamiliarity with languages other than the C type ones. I'm sure there are valid reasons for writing your own vaiant of C (just as there ave valid reasons for writing anothe Unix clone), but let's not limit people's imagination to the immediately familiar.
Re: New programming language
Posted: Fri Aug 22, 2014 3:54 am
by Nable
DaemonR wrote:Executable code shouldn't be treated like a variable.
Oh, you made me laugh. Sorry but there are a lot of interesting and useful languages (and ideas behind them) besides C&Java family.
https://en.wikipedia.org/wiki/Von_Neumann_architecture
https://en.wikipedia.org/wiki/Homoiconic
https://en.wikipedia.org/wiki/Anonymous_function
tl;dr:
1. Code is just one kind of data with it's special set of interpretation rules.
2. It easier to think that by default all functions are anonymous (i.e. defined as lambdas) and name of function is just a variable that holds address of/reference to code.
3. We can extend this idea and use references not only to functions but also to program modules.
Btw, you can see all these things in Python, that is quite popular language.
Re: New programming language
Posted: Fri Aug 22, 2014 4:51 am
by iansjack
Even C can treat executable code like a variable. Pointers to functions are not that uncommon.
Re: New programming language
Posted: Fri Aug 22, 2014 8:05 am
by Wajideu
Function pointers and assigning executable code to a symbol like you'd assign a value to a variable are two completely different things.
Is just ridiculous and inconsistent when you can do
Inconsistency is yet another reason people wouldn't want to learn something. If it were something more like:
It would be more understandable.
Re: New programming language
Posted: Fri Aug 22, 2014 8:14 am
by alexfru
DaemonR wrote:Inconsistency is yet another reason people wouldn't want to learn something.
Like a foreign/spoken language.
And yet they do.
Re: New programming language
Posted: Fri Aug 22, 2014 8:19 am
by Wajideu
alexfru wrote:DaemonR wrote:Inconsistency is yet another reason people wouldn't want to learn something.
Like a foreign/spoken language.
And yet they do.
The reasons why you learn a spoken language and why you learn a programming language are completely different. You learn a spoken language to communicate with people, you learn a programming language because it's practical or for learning experience.
Edit:
Regardless, it even deters people from learning spoken languages. Eg. A lot of people give up on learning Mandarin because the same words can have entirely different meanings just by slight differences in intonation.
Re: New programming language
Posted: Fri Aug 22, 2014 8:28 am
by iansjack
Function pointers and assigning executable code to a symbol like you'd assign a value to a variable are two completely different things.
So what else is happening when you assign a function pointer to a variable?
Re: New programming language
Posted: Fri Aug 22, 2014 8:31 am
by arakov
DaemonR wrote:Function pointers and assigning executable code to a symbol like you'd assign a value to a variable are two completely different things.
Is just ridiculous and inconsistent when you can do
Inconsistency is yet another reason people wouldn't want to learn something.
is just a short form of
Code: Select all
#symbol Program = { evaluate [ code ] }. // where "evaluate" is a method name
which is a short form of
Code: Select all
#class ProgramClass
{
#method evaluate [ code ]
}
#symbol Program = ProgramClass new.
And of course it was inspired by Smalltalk as well.
Re: New programming language
Posted: Fri Aug 22, 2014 8:33 am
by iansjack
I learn computer languages so I can communicate with computers.
Your example of Mandrin is a poor choice. Despite your reason why people wouldn't want to learn it, more people speak it than any other language.
Re: New programming language
Posted: Fri Aug 22, 2014 8:42 am
by Wajideu
When you are assigning a function to a function pointer, the code still remains referenced when the pointer changes.
Code: Select all
void fn() { }
void diffFn() { }
void (*fnPtr)() = (void (*)()) fn;
fnPtr = (void (*)()) diffFn;
Look at what happens now:
Code: Select all
#symbol Program = [ code ]
Program = [ diffCode ]
The old code doesn't just disappear, it's still there, but there are no references to it whatsoever. And what about passing arguments? And if you can't re-assign the symbol Program, then what reason is there to use #symbol instead of #method?
@iansjack, more people don't speak the language because they like it, they speak it because it's the native language of many of the world's heaviest populated countries. Right now, people are actually pushing for changes in how their own language is spoken and written because even they have trouble with it.
Re: New programming language
Posted: Fri Aug 22, 2014 8:52 am
by iansjack
The old code doesn't just disappear
Well, in Smalltalk that's exactly what happens. As there is no reference to it the garbage collector will free the memory. This doesn't happen in C because there is no garbage collection. But what is happening under the hood is irrelevant; you are still assigning code to a variable when you use variables of type function pointer.
You are quite correct about Mandrin - people learn languages for all sort of reasons, and the fact that the language may be inconsistent doesn't stop them. It's difficult to think of any languages, human or computer, that don't have their share of inconsitencies.
I think you need to open your mind a little to programming paradigms other than C-like languages. A good starter would be to learn Smalltalk.