Skip to content

Squanchy is a brand new, easy to learn, general purpose, multi-paradigm, compiled programming language. The language is written from scratch (it includes an integrated lexer, parser, code generator etc). I tried to put together Python and Haskell (or at least the main features from both) in Squanchy. In other words you can use it as a scripting …

License

Notifications You must be signed in to change notification settings

mv-lab/Squanchy-PL

Repository files navigation

contributions welcome License: GPL v3 version Maintenance code

Squanchy Programming Language

Bastard son of Python and Haskell, and failed Scratch

Important

  • code.sqy Example of code written in Squancy. Ejemplo de código escrito en Squanchy.
  • example.md Parser test example, see the AST. Ejemplo para comprobar el parser y ver el AST generado.
  • ir_code.md Comprobar la generacin de código intermedio LLVM y compilación.

About

Squanchy is a brand new, easy to learn, general purpose, multi-paradigm, compiled programming language created by:

Student at University of Valladolid. Alumno de la Universidad de Valladolid.

Work on the language began on September, 2018.

Related to the courses: Algorithms and computing, Formal Grammars and Languages. Asignaturas relacionadas: Algoritmos y Computación, Gramáticas y Lenguajes formales.

The language is written from scratch (it includes an integrated lexer, parser, code generator etc).

Why?

  • Python is lit, that's all, arguably one of the best programming languages ever.
  • I wrote the same code in Haskell and Java. Now you see how concise, clean, and perfect is Haskell code:
final int LIMIT = 50;
int[] a = new int[LIMIT];
int[] b = new int [LIMIT-5];
for (int i=0; i< LIMIT; i++){
 a[i] = (i+1)*2;
 if (i >= 5) b(i-5)= [i];
}
let a = [2,4...100]
let b = drop 5 a

So I tried to put together Python and Haskell (or at least the main features from both) in Squanchy.

Contact Ask Me Anything !

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details

Built With

forthebadge made-with-python


Getting Started

Here is Fibonacci demo program written in Haskell and Squanchy. You can see more code example in example.

fib x
  | x < 2 = 1
  | otherwise = fib (x - 1) + fib (x - 2)


fib 1 = 1
fib 2 = 2
fib x = fib (x - 1) + fib (x - 2)

Squanchy:

fib (x) -> y ::
  if x<2 then y:1 else y: fib(x-1)+fib(x-2)
  
  
fib (1) -> 1
fib (2) -> 2
fib(x) -> fib(x-1) + fib(x-2)

If you want to program in Squanchy now, see the tutorials for how to get started.

Current State

The features that are currently implemented are as follows:

  • Primitive data types List,String, Int and Double
  • Operators (+,-, *,/,**, %, :, =, >, <=, and,or, etc.)
  • Flow control (if/the/else, while loop)
  • Constants and global variables
  • Lists, Tuples and access
  • Functions
  • Lambda

The following features are coming soon:

  • Flow control (ternary ?, for)
  • Data structs
  • Dictionaries
  • array (like numpy)
  • more default functions
  • fixed visualisation module
  • ...

Contributing

This is an open source project.

contributors

You want to contribute? Please do! The source code is hosted at GitHub. If you want something, open an issue or a pull request. If you need want to contribute but don't know where to start, take a look at:

This is the main documentation of the project, only Spanish version (for the moment). Also you can checkout down below all my sources in Bibliography

Before doing anything, see Code of Conduct

Contributing Code

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Check this out if you don't know how to start:

Aims and objectives

  • Make it work
  • Basic code generation
  • Beautiful and Clean Code + documentation !!
  • Add data structures and arrays
  • IDLE for Squanchy: something easy and minimalist, just write & run like Jupyter.
  • Work on the code optimization
  • Update tutorials, documentation ...
  • a ton of things more

Bibliography

General

Lexer

Parser

Pratt Parser implementation.

Interpreter and Code generation

About

Squanchy is a brand new, easy to learn, general purpose, multi-paradigm, compiled programming language. The language is written from scratch (it includes an integrated lexer, parser, code generator etc). I tried to put together Python and Haskell (or at least the main features from both) in Squanchy. In other words you can use it as a scripting …

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages