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
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 ?
A Toy Soldier
@iamthecarisma_twitter
Not yet
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Ok
From my basic knowledge of C..
A Toy Soldier
@iamthecarisma_twitter
since there is a new way to use dll from simple developemnt will be faster
Abdulazeez Abdulazeez Adeshina
@Youngestdev
I think having the cheatsheet of SIMPLE_API will be nice
I think they are defined in one file sef.. I'll check that

What about .so and .dylib files ?

since there is a new way to use dll from simple developemnt will be faster

A Toy Soldier
@iamthecarisma_twitter
same rule apply to all shared library .so .dll .dylib
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Great then
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Quickly give me the command to compile the C code to *.so
I can't look into the files now :smile:
A Toy Soldier
@iamthecarisma_twitter
which C code
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Creating Dynamic modules.
Just a C snippet implementing a simple-lang function
A Toy Soldier
@iamthecarisma_twitter

simple, you can use the

```c
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")
```

refer to this.
the first code block in your dll.c
the second in your .sim file

Abdulazeez Abdulazeez Adeshina
@Youngestdev
Okay, I'll check that.
So the compilation command ?
A Toy Soldier
@iamthecarisma_twitter
check the Makefile-Linux.mk in consoler folder for the commands
sorry i can't paste kinda busy
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Wehhhh
I'll add that to my todo list then.
A Toy Soldier
@iamthecarisma_twitter
I have resoleved the list index [0][0] issues, which was pointed out by @appcypher while writing the hashtable library
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Okay nice..