Live data from Hacker News

OneLang – A tool to help writing code in multiple languages at the same time

ide.onelang.io

31–40 of 69 posts

Re: OneLang – A tool to help writing code in multiple languages at the same time

#31
post #4

If anybody is looking for something stable for years, have a look at haxe [1] [1] https://haxe.org

Do you have an example on how to use Haxe for a cross platform API client? Eg. Develop once, use in 12 different programming languages? The first requirement seems to be a go ( https://api.haxe.org/haxe/Http.html ) but i'm not sure of other variables for implementing this Other sources: - https://github.com/tbrosman/haxe-rest-client - https://github.com/tnwinc/rehx

Not sure if it helps, but have a look at Swagger/OpenAPI if you haven't already.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#32

Why not write one piece of code that is simultaneously valid in ~12 languages? https://github.com/stephane-chazelas/misc-scripts/blob/maste... I know it takes advantage of some technicalities (end-of-input separators and such), but it's still a remarkably impressive piece of engineering. I put that up there with some really hairy quines ( https://github.com/mame/quine-relay ), except it can actually be useful !

What are the 12 languages?

I already tried:

node perl python ruby bash tcsh

From the code it is obvious that DOS and php are on the list, but I don't happen to have them.

What are the others?

Re: OneLang – A tool to help writing code in multiple languages at the same time

#33
It seems like a really strange choice for the "source" language to be JS - a language without any real static typing capability (even with TS).

The most limited & basic kinds of static analysis are technically possible, but why not just start with an entirely static language and translate from that to dynamic languages? Would seem much simpler...

Re: OneLang – A tool to help writing code in multiple languages at the same time

#34
post #19
post #6

Earlier quoted context omitted.

How classy of you

How so? Haxe is the de facto king of the compile-to-everything space. Therefore, it's inevitable that Haxe will be mentioned on a submission like this.

> Haxe is the de facto king of the compile-to-everything space.

Indeed, I remember stumbling across it years ago while looking for a way to develop Flash games without Adobe Flash Professional. I never got around to actually try it but I keep seeing it every now and then, even saw a couple of books about it in a physical bookstore some years ago. It was the first thing that popped to mind for me as well when I saw that OP title mentioned write code in multiple languages at the same time.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#35

Earlier quoted context omitted.

Wow, sounds real mature.

At least I am not lying... ;)

Disregard them, they expect corporate style language even for a side project.

Cool concept and I actually like the wording, it hints the user, that this is a personal project.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#36
post #32

Why not write one piece of code that is simultaneously valid in ~12 languages? https://github.com/stephane-chazelas/misc-scripts/blob/maste... I know it takes advantage of some technicalities (end-of-input separators and such), but it's still a remarkably impressive piece of engineering. I put that up there with some really hairy quines ( https://github.com/mame/quine-relay ), except it can actually be useful !

What are the 12 languages? I already tried: node perl python ruby bash tcsh From the code it is obvious that DOS and php are on the list, but I don't happen to have them. What are the others?

I'm counting different editions of POSIX-compliant shell languages (e.g. ksh93, zsh, bash, [t]csh) as different, as well as massively different editions of DOS (freeDOS, MSDOS).

Hence the approximating tilde on "~12". Reasonable minds may consider there to be many fewer, or many more, compatible interpreters.

EDIT: There also appear to be multiple compatible JavaScript interpreters--browser V8 (though not Node, oddly--it's detected as generic; I may send a PR sometime), SpiderMonkey, and older IE. I'm no expert on JS runtimes, though, so the differing results I'm observing may be due to something else.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#37
post #32

Earlier quoted context omitted.

What are the 12 languages? I already tried: node perl python ruby bash tcsh From the code it is obvious that DOS and php are on the list, but I don't happen to have them. What are the others?

I'm counting different editions of POSIX-compliant shell languages (e.g. ksh93, zsh, bash, [t]csh) as different, as well as massively different editions of DOS (freeDOS, MSDOS). Hence the approximating tilde on "~12". Reasonable minds may consider there to be many fewer, or many more, compatible interpreters. EDIT: There also appear to be multiple compatible JavaScript interpreters--browser V8 (though not Node, oddly…

Thanks.

FWIW it does figure out that I am running node for v6.11.2.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#38

Went to github to see the project maturity and "OneLang is the love child of @koczkatamas and it was not a planned child. .... OneLang is six months old at the time of writing and it already speaks, but don't expect any comfortable conversation with it yet. It cannot grow without a loving family, and as a single dad I cannot take care of it alone. It needs more mommies and daddies who can help raise it up."

Wow, sounds real mature.

Just like the software itself.

It's not like this was created for Oracle to use. We don't have to wear suits all the time.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#39

It seems like a really strange choice for the "source" language to be JS - a language without any real static typing capability (even with TS). The most limited & basic kinds of static analysis are technically possible, but why not just start with an entirely static language and translate from that to dynamic languages? Would seem much simpler...

Yeah, Id choose an ML as the root language.

Re: OneLang – A tool to help writing code in multiple languages at the same time

#40

How is this different to haxe? https://haxe.org/

I started to write a comparison page here, but missing a lot of important aspects: https://github.com/koczkatamas/onelang/wiki/OneLang-vs.-Haxe... Tl;dr: you cannot use One in production now, but the grand plan is to make One as hackable and flexible as I can. So here is the plan: - the compiler does not contain any target language-specific part, you can add a new language by creating a few hundred lines of template…

This idea has been ronning around in my head, paired with a mining and crypto element.

The language specific implementations of those interfaces could be mined(by hand or automated) for coins to directly incentivise engineering effort. The block acceptance would be based on the universal tests/benchmarks passing.

Post reply on HN