Giter Club home page Giter Club logo

mv-lab / squanchy-pl Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 1.0 1.3 MB

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 language, can do maths (calculus, matrix ...) due to its functional side, work with data ...

License: GNU General Public License v3.0

Python 100.00%
lexer pratt-parser python compiler llvm parser interpreter programming-language language programming

squanchy-pl's Introduction

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

squanchy-pl's People

Contributors

mv-lab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

streetartist

squanchy-pl's Issues

Module not found

The module sqyparser Tells me it doesn't exist

No module named 'sqyparser'

Pls I need help

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.