Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
appcypher
@appcypher
I'm assuming that PR is going to be stale by now which means more work.
What I should probably have done before is to fix the modules that can work and leave the more complicated modules like the GUI module for the future.
Tackling the behemoth as a whole was a bad idea.
Adewale Azeez
@Thecarisma
Yes the PR is stall, great idea you can fix other modules and leave out the GUI dynamic module for now
appcypher
@appcypher
Is simplelang grammar documented somewhere?
Adewale Azeez
@Thecarisma
The old grammar is currently outdated, I making a new grammar and testing it against ALTR 4 for compatibility with EBNF
appcypher
@appcypher
Sweet. I will like to see it when it is done
Adewale Azeez
@Thecarisma
@/all the new grammar is available here https://simple-lang.sourceforge.io/simple.g4.txt
Sonkeng Maldini
@sdmg15
What's the purpose of that ? :thinking_face:
Adewale Azeez
@Thecarisma
It used to understand how the source code (.sim) is treated at scanning and parsing level, i.e the structure of the language
Adewale Azeez
@Thecarisma

e.g the rule

...
assignment
    : Identifier assignmentOperator ( Identifier | Number | String | List | invokeBlock )
    | Identifier assignmentOperator classInit
    | Identifier assignmentOperator propertyStmt
    ;
...
Identifier
    : [a-zA-Z_] [a-zA-Z_0-9]*
    ;
...
assignmentOperator
    : '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '<<=' | '>>=' | '&=' | '|=' | '^='
    ;

The 'assignment' rule is how simple-lang parse assignment statement
e.g

 Identifier assignmentOperator ( Identifier | Number | String | List | invokeBlock )
=
Identifier = A valid identifier 
assignmentOperator = one of the assignment operator in the above rules
(Identifier = as abover)
(Number = a valid integer)
(String = A valid string)
(List = a list item)
(invokeBlock = calling a block)

With the above that means this is valid
Name = "Sokeng" because (Name is an Identifier, = is an assignmentOperator, "Sokeng" is a string) which satisfy the rule
Identifier assignmentOperator ( Identifier | Number | String | List | invokeBlock )

So this is invalid
Name = *+# because this satisfies the rule Identifier assignmentOperator arithmethicOperator* and it not part of the assignment rule
I ll prepare a blog for more elaboration on it, also it antlr grammar you can simply look up antl grammar on google for more info
appcypher
@appcypher
Nice!
Adewale Azeez
@Thecarisma
@/all the final commit to be packed for March one has been push please kindly test if you ve got the time
@appcypher please provide a mac distro with just the simple and simple.dylib for now, minus the modules
Adewale Azeez
@Thecarisma
Documentation for the simple-lang has begin, all modules should be thorougly commented, the current doc is at https://github.com/simple-lang/simple-docs
Adewale Azeez
@Thecarisma

change the constructor implementation in this Commit simple-lang/simple@aa11a35

Before the commit the constructor behave like this. The class constructor has to be the name of the class, the draw back which is the super class constructor will not be called if the class does not have it own constructor. e.g

c = new Class() #error constructor not found

class Super
   block Super()

class Child

After the commit, constructor are simply class method with the name init in this manner if a constructor is not implemented in a class, before throwing a constructor not found exception all the super class will be queried and the first init will be the constructor

c = new Class() #display hello

class Super
   block init()
     display "Hello"

class Child
appcypher
@appcypher
Hola. I'm back! Been very busy. I apologize for disappearing like that.
I want to get my PR cleared. But that PR is so old now that I don't know if something needs to be done to get it working again.
I want to try and do something this weekend cos next week is tight for me.
How are you doing though Azeez?
appcypher
@appcypher
Where do you suggest I start from?
Adewale Azeez
@Thecarisma
Welcome back @appcypher fortunately the PR is no more needed as @iamcoderisk has provided a working mac build script which has all the modules all working
Adewale Azeez
@Thecarisma

Since you are a compiler enthusiast and I can see your works on the Web Assembly platform, I have been considering compiling to web assembly but my hand is currently full, simple currently compiles to .complex which contains the bytecodes for the program, from the bytecodes it easier to compile to assembly or transpile to other language, I ll describe the structure of the bytecode in some post later.

Another place to jump in is Documentation, publication such as wikipedia, rosetta code but the very best is more tutorial to put simple-lang on the web, recent search on google has been bringing simple-lang up to the top of the page for keywords containing simple programming

Also the modules requires implementation but I can handle that for now.
appcypher
@appcypher

Welcome back @appcypher fortunately the PR is no more needed as @iamcoderisk has provided a working mac build script which has all the modules all working

Oh sweet. I guess the PR can be closed now

@Thecarisma Cool. It would be nice to have a documentation of simple's bytecodes for the hackers
Adewale Azeez
@Thecarisma
I ll be juggling the keywords tonight for a more readable code.
call changes to from
invoke changes to call
from "external.sim" import expo

sum = block (int a, int b) {
    return a + b
}
call sum(64, 36)