This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
syfygirl's profile picture

programming language syntax

Started by syfygirl, 21 January 2015 - 11:12 PM
syfygirl #1
Posted 22 January 2015 - 12:12 AM
i'm building a programming language in a language i'm far better at than lua (for x86 and x86_64 pc's). But it features several cool features:

It's called Hydra as in it has many heads (or programming languages), hydra code is not done by any means, but can do simple tasks right now.
hydra runs in a very small virtual machine.

Here's a sample.


C# code
class program
{
   public static void Main (string[] args)
   {
	  Console.WriteLine ("I can run");
   }
}

converted to Hydra code


Hydra code
8;program;"9;Main;args|7;I can run"
10;program;Main

Hydra code byte code identifiers:
1 = new variable
2 = add
3 = subtract
4 = multiply
5 = divide
6 = if statement
7 = print
8 = class
9 = function
10 = call
Edited on 21 January 2015 - 11:15 PM
Konlab #2
Posted 03 February 2015 - 05:10 PM
Interesting.
I guess it's an OOP language.
Suggestion: Make a CC program that runs scripts from hydra.
cdel #3
Posted 06 February 2015 - 06:26 AM
This is awesome, would love writing in Python, converting to hydra then running it in cc.
syfygirl #4
Posted 12 February 2015 - 09:30 PM
would be very possible, maybe i will
oeed #5
Posted 13 February 2015 - 05:58 AM
I'm curious to know why such a language appeals to people. Isn't it just underpowered and hard to read?
Edited on 13 February 2015 - 04:58 AM
MKlegoman357 #6
Posted 13 February 2015 - 01:52 PM
I suspect that the main idea is to make a custom bytecode and its interpreter, plus a compiler for a language you already use or maybe even a new language.
syfygirl #7
Posted 13 February 2015 - 02:23 PM
YES!!! exactly and i am making it, its called Havok. Havok will also run on linux, windows, computercraft and android. (pc and android written in C/C++)
Edited on 13 February 2015 - 01:24 PM