Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
A Toy Soldier
@iamthecarisma_twitter
Javascript future enemy
You know JS is the only language for the web
Stephen
@appcypher

But I don't see an C++ code

That's coz the interpreter is written in js. https://github.com/Ratismal/brainfuck-node/blob/master/lib/index.js

A Toy Soldier
@iamthecarisma_twitter
Yes the only-lang all other language requires some hack like most people don't know that php is actually a CGI based lang likewise others like that
So in short Web Assembly will enable other lang to run in the browser just like js,
JS itself not just run in browser the browser ususally come compiled with a js interpreter like v8 engine spider monkey e.t.c so when the web assembly sequence is complete browsers will now comes compiled with a web assembly VM which means that all the browser size will increase
if you are able to strip the js engine like spider monkey from mosilla and use it on desktop well you just created another or maybe a betther platform than NODE
A Toy Soldier
@iamthecarisma_twitter
I don't really see Web Assembly final sequence anytime soon as for all the browser to agree on same thing there will be some legal bullshit with the companies except each browser create it own VM like they do with JS interpreter.
Abdulazeez Abdulazeez Adeshina
@Youngestdev

So... ?

i just check the node native addons documentation it still straight forward but different way to do almost the same thing.
Simple-lang and JS-Node can interact nicely

A Toy Soldier
@iamthecarisma_twitter
we good we ll write an interop library later
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Okay nice.
Abdulazeez Abdulazeez Adeshina
@Youngestdev

This works just with this piece of code ?

SimpleState *simple_state = initSimpleState();
executeSimpleCode(simple_state, "display 'Hello World'");
finalize(simple_state);

A Toy Soldier
@iamthecarisma_twitter
Yes, but wrapping C code is more than that
you will have to do this to be able to use a C/C++ function in simple-lang

void the_c_funct() {

}
SIMPLE_API void init_simple_module(SimpleState *sState)
{  
      register_block(sState, the_c_funct);
}
The reason for that is because when the shared library are loaded the function simple check is init_simple_module
In future we ll write better interop library that will eliminate than and the use can be seamless like load a foreign or alien shared library (dll,so,dylib) and use directly
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Ehen...
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Drop a full working example C code.
A Toy Soldier
@iamthecarisma_twitter
check all the dynamic modules e.g consoler.c
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Oh.
Baba, drop an example code fully .
A Toy Soldier
@iamthecarisma_twitter
SIMPLE_API void init_simple_module(SimpleState *sState)
{   
    //standard streams
    register_block("__std_print",std_print);
}

void std_print(void *pointer)
{
    fprintf(stdout, "%s", SIMPLE_API_GETSTRING(2) );
}
compile to your lib e.g lib.so so in simple you could do
callDynamicModule("lib.so")

__std_print("Hello World")
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Hmmm.
Nice
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Are you sure we won't do a mini cheat sheet for the SIMPLE_API ?
A Toy Soldier
@iamthecarisma_twitter
By next month we should bring up the lang actual website their are alot of thing that should be blogged about about the lang like why we do this and not that,
I ll try install wordpress on the sourceforge website to night till we have our website
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Wordpress is a blog na ?
Abdulazeez Abdulazeez Adeshina
@Youngestdev
What's up here ?
A Toy Soldier
@iamthecarisma_twitter
everything good on my side
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Nice nice.
How's the web implementation coming up ?
Stephen
@appcypher
I think we need to take a serious look at webassembly
A Toy Soldier
@iamthecarisma_twitter
We ll definitely work on the webassembly
Hey Every one i ll be pausing all my modules implementations and work on simple core itself, i ll add support for this feature and resolve some bugz in the VM such as the
   list = [[0]]  
   @list[0][0]    //resolves in error
A Toy Soldier
@iamthecarisma_twitter

I ll be adding the

getter and setter methods
operator character changes
using braces to access variables e.g

name = new Class {  name = "classic" title="new title" width = 30 height = 100  }
You can follow the new code on my dev branch i ll push to it every hour. In short i ll be re writing simple-lang to fix a lot of things
also simple-lang will support all C datatype such as long, long long, string, e.t.c
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Hmm..

Good to hear. But I'm not sure I understand totally what you meant here:

using braces to access variables

\
A Toy Soldier
@iamthecarisma_twitter
oop features PR simple-lang/simple#45
A Toy Soldier
@iamthecarisma_twitter
i ll be adding a supporting library to the C/C++ wrapper code for simple-lang, the wrapper code will soon be optional if you want to define blocks from within C/C++, i ll create a new library that will foster the use of any foreign DLL at anytime.
The new library is inspired by me thinking how i ll exports OpenGL, SDL, FLTK with over 100,000 of functions to simple-lang that kinda suicide
so we can dismiss all our dynamic modules if we wish
a similar implementation is the .NET interops and python ctype
A Toy Soldier
@iamthecarisma_twitter

en example using a class approach

call simple.system.interop

lib = new DynamicLibrary("opengl.dll")
lib.callFunction("DrawCircle", [parameter1, parameter2, parameter3])

using block approach

call simple.system.interop

lib = loadDynamicLibrary("opengl.dll")
callFunction(lib,"DrawCircle", [parameter1, parameter2, parameter3])
a more familiar approach using the printf from libc
call simple.system.interop

lib = loadDynamicLibrary("libc")
callFunction(lib,"printf", ["Hello %s i can see you %s \n", "appcypher", "online"])
//will print 'Hello appcypher i can see you online' in the console
A Toy Soldier
@iamthecarisma_twitter
This way we won't be needing to have external libraries like fltk, ssl, curl in our build tree we will just get the compiled version from reliable source and place in same folder as simple.(dll,so,dylib) which will allow fast and smooth building and even less code written
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Hmm.. Pretty nice and precise. I think this will ease some stress..
A Toy Soldier
@iamthecarisma_twitter
Please review the last PR
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Oh, ok.. You saw my comment ?
A Toy Soldier
@iamthecarisma_twitter
Yea i already replied