Author Topic: Emerald Programming Language / VixenVM  (Read 11215 times)

0 Members and 1 Guest are viewing this topic.

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #15 on: May 11, 2011, 01:27:22 pm »
As a suggestion, try to not make the interpreter and editor ridiculously massive. If someone wants to play Pong, he's not gonna download an extra 1 megabytes interpreter, plus it would take a long while to transfer to the calc anyway.

Also make the editor user-friendly, because for example with BBC Basic for the 83+ people were turned away by the editor.

I plan to make an editor in the future, tokens-based ;) you see, I'll be releasing VixenVM in two forms -- a full version with a compiler AND IDE AND interpreter, and a interpreting-only version that wil be significantly smaller and onyl runs compiled bytecodes.

Qwerty: inserting hEx actually won't be that had of a thing to implement ;) in fact, I might go GCC style and have a function in mainlib.emh that inputs blocked hEx code (though no mnemonics, though I'm sure you're fine with that ;)) and when the starting opcode is seen by the interpreter, it stops interpreting, and simply runs in the background while the hEx is run as assembly code, going until a stop codon is found ;)

hEx won't be extremely simple to implement, but following the Codon Interpreting Theory I should be able to do it decently ;)

Also, graphics commands are much easier :D I plan to include a library that has simple sprite, pixel editing, and alpha channeling commands included.

Right now I'm debating as to what libraries in Emerald will be written in, either C or Emerald bytecode...

Any other ideas?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Emerald Programming Language / VixenVM
« Reply #16 on: May 11, 2011, 01:32:48 pm »
Please don't start with the "hEx" nonsense. It's unnecessary and rather discriminatory. Also, I was asking about inserting hex into the bytecode, not hexadecimal machine code.
« Last Edit: May 11, 2011, 01:35:37 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #17 on: May 11, 2011, 01:54:54 pm »
it's not intended as discriminatory in any way ;) just so you know:

hex -- just hexadecimal numbers
hEx -- programming with hex opcodes

not negative in any way, it's just a quick way to segregate the two.  Please don't try to start unnessicary fights.

and, inserting hex into a source file will be pretty easy :)

« Last Edit: May 11, 2011, 01:55:13 pm by Ashbad »

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #18 on: May 11, 2011, 09:33:25 pm »
I have decided to change the idea of the 'Stack Theory' I had -- it was a decent idea, but the way I implemented it was stupid.  However, it did evolve into GROUPING, the main form of inheritance and erm, grouping objects in emerald.

Basically, a group of objects are all related by an 'extending' type (class).  everything in that group inherits everything from that group's master type (superclass).  Every object in there is not extended to that master type during declaration, but during generation.  This means that one class can be made in unique forms and can extend different types.

Another thing about the 'Group Theory' of mine is that it allows more flexibility of Object Polymorphism.  You see, everything in a group extends a master type -- that makes all grouped objects 'brethren' classes.  Protected attributes can by shared only among brethren types.  However, I also plan to have it so that groups can be grouped my master groups, so then that makes all brethren objects in one group brethren with brethren objects in another group.  This layout totally kicks out the wall of normal OOP and can actually be quite useful in a large variety of applications, whereas an OStack most likely won't.  Thanks for all the advice christop, sorry about my bit chin' :P

Another thing: I've been reading about different programming languages lately, from ALL paradigms and generations that can be found on wikipedia, and from that I've gotten interesting ideas.  Please express what you think of them:

- Atom variable types, which basically define anything you set them to define.  This can lead to confusing code, but on the contrary in some instances can also lead to cleaner implementations

- when you further a class with the 'further' and '/further' keywords, you don't just define a type.  'further' can be used any time, any place to extend the attributes of a type -- so you can create tons of cats with only a name, but later extend them to also have an age (I actually came up with this one on my own)

- simple polymorphic code

- you can declare a class anywhere -- and with polymorphic code included, you can put a class declaration in a nloop (for loop) and change the name of the class you define each loop, so you can effectively create 100 types in <5 lines of code (kinda came up with this on my own)

- allow for pure-functional code to be the basis of a program as well, to support many different paradigms to help more people enjoy the language (well, I obviously ripped this from >50 modern languages :))

any others?  I spent a while today thinking these up, so I would appreciate any concerns, comments, or suggestions :) and I'll try to be more grateful for feedback from now on; again, sorry christop, no hard feelings I hope.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Emerald Programming Language / VixenVM
« Reply #19 on: May 11, 2011, 10:32:24 pm »
Sadly I don't code much anymore so I don't understand that stuff much, but hopefully you can find something that satisfy people well in overall.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Emerald Programming Language / VixenVM
« Reply #20 on: May 11, 2011, 11:35:27 pm »
For Vixen I would suggest using Qwerty's Khavi framework as the byte code loader. Khavi is designed to work as a virtual machine framework and is well suited for interpreters and emulators. It is very fast, small size, and can handle threads.

And for Emerald make sure you keep in mind the other languages on the Prizm. Yes there is an Axe like language planned, but sometimes a user would prefer an interpreted language over a compiled one for easier and faster coding. Then on the interpreted side you have both Lua and Java, but both of those are computer compiled. I would though match the language difficulty with Lua, but easier than Java and harder than BASIC. And yes there is also a planned BASIC interpreter rewrite, but that is not byte code so is a little bit slower plus it doesn't have OOP. I would almost think of Emerald as advanced BASIC  as that would be your target group, experienced BASIC coders who feel restricted by current BASIC constraints.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Emerald Programming Language / VixenVM
« Reply #21 on: May 12, 2011, 08:53:05 am »
It definitely needs to have the smallest and faster interpreter possible for production, but there should also be a development interpreter that can help with debugging.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #22 on: May 12, 2011, 01:13:39 pm »
I don't think I'll be using Khavi, since this is going to be personalized for Emerald coding only ;)

..

Why you might ask?  Unless Khavi supports OOP high level commands, multithreading, and background operations, plus other ideals, it will not be suitable ;)
« Last Edit: May 12, 2011, 02:01:23 pm by Ashbad »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Emerald Programming Language / VixenVM
« Reply #23 on: May 12, 2011, 03:21:47 pm »
I think he was asking so maybe there is only one single add-in required for every existing third-party Casio PRIZM languages. Basically this would be to prevent people who want to program in multiple languages or run interpreted games from having like 10 different add-ins to do so. Another example is how Doors CS can run games from all shell, while with MirageOS, you still needed to carry Ion for certain games, xLIB for others, Celtic III for others, CalcUtil to do backups, etc.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Emerald Programming Language / VixenVM
« Reply #24 on: May 12, 2011, 03:42:36 pm »
Why you might ask?  Unless Khavi supports OOP high level commands, multithreading, and background operations, plus other ideals, it will not be suitable ;)

Not sure what you mean by "background operations," but the first two are a definite Yes and the second is probably yes as well.

However, I don't think Khavi would be suitable because it requires that you have some level of control over what the machine code looks like, something that C is notoriously bad at providing. It's probably possible to do in C, but it'd likely require a lot of inline ASM.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #25 on: May 12, 2011, 03:49:40 pm »
well, I might be able port it to Khavi in the future, but Vixen will take a tight grip over emerald source programs, and transferring this to Khavi would possibly lead to high levels of underutilization of interpreting.  However, feel free to post some features of Khavi here :)  I'm interested as to what it can provide emerald with.

EDIT: and if anyone here has ANY suggestions, I bade you to please post them :)
« Last Edit: May 12, 2011, 04:12:09 pm by Ashbad »

Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #26 on: May 13, 2011, 05:57:15 pm »
Here are some updates that were on cemetech -- they seemed to ask more questions with the specifics --

Quote from: Ashbad
I have decided to change the idea of the 'Stack Theory' I had -- it was a decent idea, but the way I implemented it was stupid.  However, it did evolve into GROUPING, the main form of inheritance and erm, grouping objects in emerald.

Basically, a group of objects are all related by an 'extending' type (class).  everything in that group inherits everything from that group's master type (superclass).  Every object in there is not extended to that master type during declaration, but during generation.  This means that one class can be made in unique forms and can extend different types.

Another thing about the 'Group Theory' of mine is that it allows more flexibility of Object Polymorphism.  You see, everything in a group extends a master type -- that makes all grouped objects 'brethren' classes.  Protected attributes can by shared only among brethren types.  However, I also plan to have it so that groups can be grouped my master groups, so then that makes all brethren objects in one group brethren with brethren objects in another group.  This layout totally kicks out the wall of normal OOP and can actually be quite useful in a large variety of applications, whereas an OStack most likely won't.  Thanks for all the advice christop, sorry about my bit chin' :P

Another thing: I've been reading about different programming languages lately, from ALL paradigms and generations that can be found on wikipedia, and from that I've gotten interesting ideas.  Please express what you think of them:

- Atom variable types, which basically define anything you set them to define.  This can lead to confusing code, but on the contrary in some instances can also lead to cleaner implementations

- when you further a class with the 'further' and '/further' keywords, you don't just define a type.  'further' can be used any time, any place to extend the attributes of a type -- so you can create tons of cats with only a name, but later extend them to also have an age (I actually came up with this one on my own)

- simple polymorphic code

- you can declare a class anywhere -- and with polymorphic code included, you can put a class declaration in a nloop (for loop) and change the name of the class you define each loop, so you can effectively create 100 types in <5 lines of code (kinda came up with this on my own)

- allow for pure-functional code to be the basis of a program as well, to support many different paradigms to help more people enjoy the language (well, I obviously ripped this from >50 modern languages :))

any others?  I spent a while today thinking these up, so I would appreciate any concerns, comments, or suggestions :) and I'll try to be more grateful for feedback from now on; again, sorry christop, no hard feelings I hope.

My theory of defining a class more at any given time:

Quote from: Ashbad
Kerm, I'm sure you wouldn't be editing a class' structure regularly, but let's say you have a program like this:

Code: [Select]
~seep classpath

define group Suspects further
   accept Man, Woman, CreepyGuy, etc
/further

define type Man further
   define creator Man void () further /further
   define String name "Merth"
/further

define type Woman further
   define creator Man void () further /further
   define String name "Melissa"
/further

define type CreepyGuy further
   define creator Man void () further /further
   define String name "Obama bin LOVING AMERICA!"
/further

Man Merth generate from Suspects Man()
Woman Melissa generate from Suspects Woman()
CreepyGuy Obama generate from Suspects CreepyGuy()

 # Let's say we want to know more about the creepy guy
 # So, let's set him up with a 'Favorite Food'

type CreepyGuy further
   define String FavoriteFood "Unsuspecting teenagers"
/further

###
 this helps us so we can pinpoint a crime directly onto him,
 in this case obviously being a... creepy guy.
 somewhat lame example, but I think it's decent enough to
 get the gist of it :)
###


somewhat bad example, but it does work fine in explaining methinks.

Duck typing came up, but christop proposed it would lead to too much overhead on a calculator, so I pretty much dumped he idea (that and because it wouldn't be as easy to implement.

The variable type 'atom' as described above is now renamed 'rien' variables, which means 'anything' in french.  Once they are defined with a type, their type remains static.

Kerm wondered exactly what Emerald was to provide (good question, actually) so my response:

Quote from: Ashbad
Full applications.  The thing is, unlike that stupidly funny EmulatorLanguage he posted (which, when I read it, seems quite funny :P) this is being made such as in the same way Ruby, Groovy, etc. were made -- the creator thought that existing languages could either use a little 'oomph' or even a different style of implementation of modern features, which is essentially what I'm doing -- if you read any syntax from the past few pages, you'll realize that many things are different in Emerald -- maybe not enough differences to merit a 'Brainf*ck' award, but it is considerably different.

One thing about Emerald is that it's meant to portray a different perspective on today's view of Programming Science theories.  Such as my method of OOP -- literal groups that are treated in a way somewhat like a type themselves that hold actual references to objects, master types, further polymorphism merits, and even more is quite different than the normal "Class JavaClass extends Object" method.  Maybe it'll fail to attract that much of an audience at all -- but then again, I'm sure some would love the radically different ideals, and would use it.

And, the only reason I'm implementing it on a calculator is because I think C++ is disgusting, C isn't OOP, Java is lame, Lua is slow, BASIC is Lua--, Axe is even less OOP than C, and I need something that's IMO good to write stuff in on calc since the others do not appeal to me.  Of course, I could always port Ruby or the like, but even then, I need a better project than converting something that can probably be ported with minimal stress :D

I intend for it to be used in a wide array of applications.  Whether or not people DO use it, it's up to them, but I will be one who won't code in anything else.

And, to force people to have at least a rudimentary version of Vixen on their calculators, I will only write my stuff in Emerald, and if you want to play/utilize my applications, you need my other applications ^-^

I am taking this project extremely seriously and unlike all my other crap ideas, this already has everything from a timeline to > 100 hours of my thought and theory.  It has twice as much planning as my eagle project did, and still hundreds of hours more until a stable 1.0 will even be released.  I expect most of my summer coding to be devoted to this -- I'm even forming a flexible timetable for advancements in the project details.  This isn't like Suave, Lo-C, or 'DE, it has a lot of devotion going into it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

With that being said, I've already started theorizing the exact functions of VixenVM, its operations, and how it interacts with a program.  Basically, it 'wraps itself around the program like a snake' and in turn the program 'force feeds Vixen with bytecodes and instructions'.  Here is how a program initialization will work:

1. Vixen reads through the program's header and preliminary VM-specific instructions while the program is finalized for cases of runtime-applicable polymorphic coding
2. Vixen starts by loading 64 bytecode-grouplets (the operation and the parameters, plus other aspects of the bytecodes being analyzed) into a quick-to-access bytecode buffer
3. Vixen starts a thread that interprets the operations in the bytecode-buffer
4. right after, Vixen then starts a simultaneous thread that loads more opcodes into the buffer that the first thread reads.  This thread  remains inactive until the other thread gives an output signal that it has finished a bytecode-group and quickly adds another onto the buffer while the other thread starts reading the next in line, and chucks out the old one.  These last actions happen simultaneously.
5. (still thinking)

[more to come in an hour or so]

Qwerty asked:

Quote from: Qwerty.55
Quote from: Ashbad
With that being said, I've already started theorizing the exact functions of VixenVM, its operations, and how it interacts with a program.  Basically, it 'wraps itself around the program like a snake' and in turn the program 'force feeds Vixen with bytecodes and instructions'.  Here is how a program initialization will work:

1. Vixen reads through the program's header and preliminary VM-specific instructions while the program is finalized for cases of runtime-applicable polymorphic coding
2. Vixen starts by loading 64 bytecode-grouplets (the operation and the parameters, plus other aspects of the bytecodes being analyzed) into a quick-to-access bytecode buffer
3. Vixen starts a thread that interprets the operations in the bytecode-buffer
4. right after, Vixen then starts a simultaneous thread that loads more opcodes into the buffer that the first thread reads.  This thread  remains inactive until the other thread gives an output signal that it has finished a bytecode-group and quickly adds another onto the buffer while the other thread starts reading the next in line, and chucks out the old one.  These last actions happen simultaneously.
5. (still thinking)

You can't have simultaneity on a single core processor. Accordingly, there's almost certainly going to be a way to get the instruction parser to overrun its buffer. Also, I don't see why you need a secondary buffer if you're not going to do explicit caching or JIT compilation. It seems like you're just going to waste cycles copying data that's already in the file you're reading from.

Just a thought.

PS: The "Snake/living VM" thing sounds pretty much like the standard VM model. Is there a difference?

I responded:

Quote from: Ashbad
Well, basically, I didn't write much of what's truly going on, because that takes a very large and complex diagram ^-^

the cache loader does some hand-over interpretation to make the main interpreter go faster, and since it can happen simultaneously (there's a wide array of ways to achieve multitasking on single-core processors) it will reduce overhead.



So, a lot of updates here -- I thought I should share them, as most of them are extremely important ones.


Ashbad

  • Guest
Re: Emerald Programming Language / VixenVM
« Reply #27 on: May 13, 2011, 09:55:12 pm »
since I have thought of a way to implement them with little strife, I will be allowing for lambda, or anonymous functions to be used in Emerald programming.  The approach is exactly the same as Ruby's:

Code: [Select]
Function = lambda {|x, root| x**root}

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Emerald Programming Language / VixenVM
« Reply #28 on: May 13, 2011, 10:15:22 pm »
This seems nice Ashbad. In the end the language has to be user-friendly, while still being powerful. Unfortunately I don't understand everything that was said above but I wish you luck in this project.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Emerald Programming Language / VixenVM
« Reply #29 on: May 13, 2011, 10:18:17 pm »
Looks good and I think I understand about 3/4 of what was said. I believe that is a great success for me

Good Luck. We might want a port of this to Nspire sometime...
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y