Giter Club home page Giter Club logo

novum-lang's People

Contributors

noituri avatar

Watchers

 avatar

novum-lang's Issues

If elif else

I don't think I have to explain this.
Example:

if a > b
   // Do something
elif b < a
   // Do something
else
   // Do something
end

Strings

Example:

let x: str = "That's a string"

" can be used to create string

Arrays

Basic syntax for arrays:

x: Arr<Type> = [t1, t2, t3]
x[0] = t4
x.append(t5)

Loops

Infinite loop:

while(true) equivalent:

loop true
   // do something
end

for x in array equivalent:

loop i, v in array
   // do something
end

float (dot) bug

Float number can have couple dots. What I mean by that is float can look like that 3.20.1 which is incorrect

Primaries

this will allow the user to define it's own unary or binary operator (for example Str == Str etc. It will be very useful in libstd)

Atoms

Atom is a type and value at the same time
Example:

x := :atom 
if x == :another_atom

end

Return

return keyword does not work at the moment (there is no codgen, parser & ast support for return, only lexer has implemented return token)

better return handling

Here's example from Rust:

fn do_something() -> i32 {
   if true {
      return 0;
  } else {
     return 1;
  }

   // every case is handled so I don't have to put return here
  // return 2
}

I want to add the same thing in ExpectoLang

CLI

Make CLI for compiling purposes
List of commands:

  • expecto build
  • expecto build --emit-llvm
  • expecto run
  • expecto version

classes

So classes will probably change but for now it will probably look like that:

class Example
   let mut val: int
   fc init(x: int)
      val = x
   end
   fc print()
      writeln(val)
   end
end

let example: Example = Example(2)
example.print()

Escaping strings

Escaping strings does not word very well. What if mean by that is GoLang by default when it reads str it does escape "\n" so it's not really new line, also llvm is escaping "\n"

Fix external functions

As for now external functions look like that:

@printf(x)

it should look like that:

@printf(x: str): int

write/writeln

This functions simply print data in your terminal.

Comment

As for now # is used to comment code but I'd like to use // for single line comment and /* */ for multiline comments

Booleans

boolean type

Example:

let x: bool = false
let y: bool = true

ParseExpression bug

If I try to use 3 + 1 everything works just fine but If I add third number (or more) it starts to break expression, so 3 + 1 + 4 does not work. 4 is parsed as next expression

Better error handling

At the moment when you'll make syntax error you'll probably get arbitrary error that won't tell you a thing how to fix your problem

Positions in parser

Every ast has position (current character) and as for now not every position is valid for given AST, also position should not only consist of current character but also current line

Variables

Variables by default are not mutable.
They can be redefined.
As for now they won't detect type dynamically (but it will be added)

Example:

let x: int  = 4

// variable redefinition
let x: float = 3.0

// probably syntax for mutable variables
let mut x: bool = true

Or

x: int = 4
x := 5.0
x: mut float = 1.23
x = 2.0

y: bool

@ keyword

So @ will be keyword for calling extern functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.