Freebasic to JavaScript-Converter ?

Emscripten, WASM, and asm.js related questions
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Freebasic to JavaScript-Converter ?

Post by Coolman »

PB2Web a PureBasic to JavaScript-Converter :
http://pb2web.de/
http://pb2web.de/forum/index.php

Phaser : 2D game framework
http://pb2web.de/forum/index.php?topic=102.0
http://www.photonstorm.com/phaser

awesome job ...

is there a equivalent FreeBasic ?

FreeBasic to a javascript converter could help generate the consistent linux windows macos ios android cross-platform programs ...
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: Freebasic to JavaScript-Converter ?

Post by VANYA »

PB2Web a PureBasic to JavaScript-Converter
All this nonsense, complete nonsense. Java script - very easy language (easier to learn) what for still write on something, then after parsing to get a bunch of extra code generated.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Freebasic to JavaScript-Converter ?

Post by Coolman »

I'm not talking about the simplicity of the language javascript (I know ...) but make programs FreeBasic multi-platform. JavaScript is practically on all systems ...
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Freebasic to JavaScript-Converter ?

Post by dkl »

FB is about native code from the beginning (thinking about pointers, C ABI compatibility, inline ASM), so naturally it can't work in virtual/scripting environments, at least not without removing/disallowing lots of these things. But then a lot of FB programs won't work in that environment.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Freebasic to JavaScript-Converter ?

Post by anonymous1337 »

I think having syntax options on the web are a good thing. Even with standard web technologies, there are alternatives such as HAML (for HTML), LESS and SASS (for CSS), and server-side processing languages such as Razor (for C# "cshtml" views in MVC.).

If I wanted to code Ruby or BASIC on the web, would that be so bad?

I think the only issue is that most people don't use the web the same way you would normally use BASIC. A BASIC to JavaScript convertor would be more valuable server-side, IMO.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Freebasic to JavaScript-Converter ?

Post by marcov »

anonymous1337 wrote:I think having syntax options on the web are a good thing. Even with standard web technologies, there are alternatives such as HAML (for HTML), LESS and SASS (for CSS), and server-side processing languages such as Razor (for C# "cshtml" views in MVC.).

If I wanted to code Ruby or BASIC on the web, would that be so bad?
Use VB.NET and ASP ? :-)

There is a point though to that provocative statement: while one could argue about adding more weblanguages that are virtually indistinguishable to Javascript except for some basic syntax is pointless, assume that need as a given for now. At least for some of us.

The main point is that such effort would have to come from one of the Basic interpreters or from a new project, not from the compilers, like FB. A bit of base syntax is simply not enough commonality for it to be in the same project as a base, native compiler.

Everything FB has outside the basic parser would just be unnecessary luggage, and the differing requirements would only cause strife between web and native devels. And once the webbers start adding javascript borrowed syntax, there would even be dissent in the parser.
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Re: Freebasic to JavaScript-Converter ?

Post by rolliebollocks »

If you're talking about a translator, I think it would be very difficult. I think it would be more difficult in fact, that translating C++ into JavaScript. I've worked on projects where I translated FreeBASIC into JavaScipt and I needed a number of workarounds where the pointer architecture was concerned. Translating JavaScript into FreeBASIC is even more difficult because the native array type is really an indexed list and FB has no native equivalent. I imagine the process would be painful.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Freebasic to JavaScript-Converter ?

Post by marcov »

And don't forget the average advanced source on this forum being full of preprocessor-foo due to the lack of generics.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Freebasic to JavaScript-Converter ?

Post by Coolman »

I found an equivalent project for FreePascal:

https://code.google.com/p/extpascal/
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Freebasic to JavaScript-Converter ?

Post by Coolman »

in case someone would be interested, I found this language (BrowserBasic) :

http://retrogamecoding.org/board/index. ... board=13.0
angros47
Posts: 2329
Joined: Jun 21, 2005 19:04

Re: Freebasic to JavaScript-Converter ?

Post by angros47 »

A linux emulator has been made in javascript:

http://bellard.org/jslinux/

if you manage to run a program written in freebasic on it, you could achieve what you want.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Freebasic to JavaScript-Converter ?

Post by Coolman »

Awesome created by the author of qemu. only for text mode. not yet at the point graphically. in all it gives an idea of ​​the power of language javascript ...

in the same kind Tululoo Game Maker. the author shows the source code is in PureBasic. I just tested. interesting. damage that is not made ​​FreeBasic. to see here:

http://www.tululoo.com/
v1ctor
Site Admin
Posts: 3804
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Re: Freebasic to JavaScript-Converter ?

Post by v1ctor »

There is a C/C++ (actually LLVM bytecode) to javascript: https://github.com/kripken/emscripten/wiki.

When the FB's LLVM backend is finished, it should be possible to use Emscripten to compile FB to javascript.

Then you need the FB runtime lib and the gfxlib also in javascript, but probably someone will have to "port" the rtlib (and the gfxlib), writting the helper functions in javascript.

If even the Unreal engine was ported using that compiler, anything is possible.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Freebasic to JavaScript-Converter ?

Post by Coolman »

thank you for the link. very interesting ...
Post Reply