onelang / OneLang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Required basic features for code generator

koczkatamas opened this issue · comments

  • RegExp match
  • RegExp test (?)
  • RegExp replace
  • String split
  • String concat
  • String join (?)
  • Array SubArray (?)
  • Any to string (?)
  • JSON parse
  • YAML parse
  • Enum support
  • Map support (contains key, remove, add, get values, get keys)
  • Import tracking (causes Go error)

I've been trying to figure out how to get anonymous functions into Onelang. I see why you left them out, it's tough! Especially when trying to generate them across all the different languages.

In my opinion, adding anonymous function support should be high on the priority list. I'm still trying to figure out the best way to add it to Onelang.

By the way, I think there'd be a lot more support if there was only a single language used to generate code, in my opinion, it should be Typescript. It was after all what it was designed for.

By the way, I think there'd be a lot more support if there was only a single language used to generate code, in my opinion, it should be Typescript. It was after all what it was designed for.

Currently only TypeScript used for code generation. The project also includes python and bash scripts, but those only for auxiliary functionalities. Which non-TS code part were you referring to?

Preferably just adding anonymous functions to TypeScript. Here's an example:

let anonFunction = function ()
{
    console.log ("Anonymous function");
}

function TestFunction ()
{
    console.log("Test function");
}

anonFunction ();
TestFunction ();

Both of these won't work. I get that a regular function such as TestFunction above won't translate properly into Java and C#. However, the anonFunction should. Problem is, I'm still going through your codebase trying to figure out how to best get anonymous functions such as anonFunction in.

btw, do you have any pointers for me on how to add that functionality?