Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Busari Habib
@Bahat159
You made your point @TNkemdilim, I want simple to be a standalone language which won't have to depend on any other language to fully operate, if you don't know we have the expertise to develop and operating system from scratch with the language whenever it's needed, the assembly language to embed in it will be dealth with, as for the yorlang it won't go further than what It is, its just for those who want to play around with a new toy,
Simple is going to be great, we will develop it to its fullest ability with time, we will also embrace our beloved language and hack it ourselves before others do,but now let continue to develop the language, it shouldn't be too complex, with th current development muxh will be removed from ehat it aleady has, sorry to say but thays the truth, it will soon be hacked for any leakage and vulnerability issues, we have the expertise to work it as well. If it will grow to were I envisioned it will just like our beloved C language.
A Toy Soldier
@Thecarisma

What is everybody take on using the character to print value with extra line at the end

@"Hello World"

Does any body find this odd and has an alternative or wants it out, pending the next release which will be a Minor Major release.

Also any bad design decision in the language should be pointed out now, there ll be no major changes to syntax after this release
Busari Habib
@Bahat159
@ from sed or awk right?? This things will only make the language complex and hard to read, remember we have different programmers with this one would have iyd preference
A Toy Soldier
@Thecarisma
So you opting in for the removal, i second the removal,as the @ in future by frameworks, compilers and IDE for more semantic and compilation option and feature
the Console module is bouyant enough to handle any operations with the system standard streams
A Toy Soldier
@Thecarisma
And please @Bahat159 what is iyd preference
Abdulazeez Abdulazeez Adeshina
@Youngestdev
Well, the @ can stay. It'd be useful in large programs. The display keyword should be used in smaller programs
Busari Habib
@Bahat159
I mean different ways of writing their programs
A Toy Soldier
@Thecarisma

@Youngestdev for both large and small programs the Console is the better alternative, check my recent update the examples no more uses display and @ instead they uses the stdout, stderr and stdin from the Console module. This will ensure more security and more advance way of printing and reading from standard stream. the following are being alternated

stdout.print() #instead of display
stdout.println() #instead of `@`

The displaycan be spared for use for quick debug and short samples like the native hello world. the std streams in console are very efficient as they also resolve escape characters and the printf() which works like the native C printf is under development

Prince E. Darlington
@iamcoderisk
hello guys?
Azeez, you have done well, but i was thinking of having stdout imported for reusability sake; thereby enhancing the gradual usage of print() and println()
Tochukwu Nkemdilim
@TNkemdilim
I second @iamcoderisk
Prince E. Darlington
@iamcoderisk
i could send a PR on this if we agree
A Toy Soldier
@Thecarisma
@iamcoderisk imported in what way, stdout is in the Console module which will have to be imported before using stdout, stderr and stdin, please elaborate
A Toy Soldier
@Thecarisma

@/all I am adding compilation to object code to simple-lang to get ride of the module and make the entire source into one file of bytes codes like javac. The compiled source will be independent of the modules, such that when the compiled version is taken to another computer which does not have the modules it will execute. The advantages are below :

  1. Compile the source to one object file
  2. The compiled version is independent of the modules but still dependent of the dynamic modules
  3. It can be easily embeded in wrapper applications
  4. Very useful for creating polymorphic code
  5. It make the simple source secure as it not human readable
  6. Speed upexecution time as the scanner, parser, analysing are skipped, just read compiled file the run bytecode in VM

Disadvantage

  1. It not human readable and cannot be manually edited (likely an advantage)

to compile to object code after implementation

$ simple --simplify simple.sim

It generate a corresponding object file in the same folder

It not a compilation to machine code like C/C++, it compile to bytecode simple-lang vm can understand just like what java does by compiling to a bytecode file javac that can be executed on all the java distro.
Another advantage is that since simple-lang resolve called file during parsing time, it compilation is complete on a system it will give not import issues on whichever platfor it executed
A Toy Soldier
@Thecarisma
I currently adopt .complex as the file extension for the compile source as it opposite to simple and is not human readable
I need your inputs.
A Toy Soldier
@Thecarisma
A new PR requesting reviewers simple-lang/simple#59
Steve Akinyemi
@appcypher
ping. What's up fellas?
A Toy Soldier
@Thecarisma
Heyo, alot of upgrade and update has been going on
You can check the major push here simple-lang/simple#59
@appcypher It ll be great to have you review the MAC OS build since it the only PR that has been stalled for months
Steve Akinyemi
@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.
A Toy Soldier
@Thecarisma
Yes the PR is stall, great idea you can fix other modules and leave out the GUI dynamic module for now
Steve Akinyemi
@appcypher
Is simplelang grammar documented somewhere?
A Toy Soldier
@Thecarisma
The old grammar is currently outdated, I making a new grammar and testing it against ALTR 4 for compatibility with EBNF
Steve Akinyemi
@appcypher
Sweet. I will like to see it when it is done
A Toy Soldier
@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:
A Toy Soldier
@Thecarisma
It used to understand how the source code (.sim) is treated at scanning and parsing level, i.e the structure of the language
A Toy Soldier
@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
Steve Akinyemi
@appcypher
Nice!
A Toy Soldier
@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
A Toy Soldier
@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
A Toy Soldier
@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
Steve Akinyemi
@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?
Steve Akinyemi
@appcypher
Where do you suggest I start from?
A Toy Soldier
@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
A Toy Soldier
@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.
Steve Akinyemi
@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
A Toy Soldier
@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)