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
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
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Okay. I'm checking that now.
There's a new comment, you haven't replied yet.
Someday I hope JavaScript codes will be compatible with simple.
Dynamic modules can only be created with C and C++..
Also talking about WebAssembly.. What's the main deal ?
A Toy Soldier
@iamthecarisma_twitter
We ll look into webassemble and js compatibility later
i have returned a comment on the PR
Abdulazeez Abdulazeez Adeshina
@Youngestdev
EHen
Do look into it sha.

ok.

i have returned a comment on the PR

Also, how's the web implementation coming up ? Already working towards it ?