Code Monkey home page Code Monkey logo

simplefastturtle's Introduction

SimpleFastTurtle

SFT is an interpreted programming language written in C, currently in early stage of developpement.

Goals

Provide a simple to use and fast programming language to perform some specific functions.

Deeper understanding of how programming languages work.

Preview

Code

var aLittle = 4;
var aLot;

if aLittle < 2
    aLot = 1000
else
    aLot = 2000

fn average(a, b)
{
    return (a + b)/2
}

print(average(aLittle, aLot));

Tokens

[Line: 2		Type: 2		Id: 74		Symbol: var		]
[Line: 2		Type: 4		Id: 100		Symbol: aLittle		]
[Line: 2		Type: 0		Id: 61		Symbol: =		]
[Line: 2		Type: 3		Id: 97		Symbol: 4		]
[Line: 2		Type: 1		Id: 59		Symbol: ;		]
[Line: 3		Type: 2		Id: 74		Symbol: var		]
[Line: 3		Type: 4		Id: 100		Symbol: aLot		]
[Line: 3		Type: 1		Id: 59		Symbol: ;		]
[Line: 5		Type: 2		Id: 66		Symbol: if		]
[Line: 5		Type: 4		Id: 100		Symbol: aLittle		]
[Line: 5		Type: 0		Id: 60		Symbol: <		]
[Line: 5		Type: 3		Id: 97		Symbol: 2		]
[Line: 6		Type: 4		Id: 100		Symbol: aLot		]
[Line: 6		Type: 0		Id: 61		Symbol: =		]
[Line: 6		Type: 3		Id: 97		Symbol: 1000		]
[Line: 7		Type: 2		Id: 68		Symbol: else		]
[Line: 8		Type: 4		Id: 100		Symbol: aLot		]
[Line: 8		Type: 0		Id: 61		Symbol: =		]
[Line: 8		Type: 3		Id: 97		Symbol: 2000		]
[Line: 10		Type: 2		Id: 73		Symbol: fn		]
[Line: 10		Type: 4		Id: 100		Symbol: average		]
[Line: 10		Type: 1		Id: 40		Symbol: (		]
[Line: 10		Type: 4		Id: 100		Symbol: a		]
[Line: 10		Type: 1		Id: 44		Symbol: ,		]
[Line: 10		Type: 4		Id: 100		Symbol: b		]
[Line: 10		Type: 1		Id: 41		Symbol: )		]
[Line: 11		Type: 1		Id: 123		Symbol: {		]
[Line: 12		Type: 2		Id: 70		Symbol: return		]
[Line: 12		Type: 1		Id: 40		Symbol: (		]
[Line: 12		Type: 4		Id: 100		Symbol: a		]
[Line: 12		Type: 0		Id: 43		Symbol: +		]
[Line: 12		Type: 4		Id: 100		Symbol: b		]
[Line: 12		Type: 1		Id: 41		Symbol: )		]
[Line: 12		Type: 0		Id: 47		Symbol: /		]
[Line: 12		Type: 3		Id: 97		Symbol: 2		]
[Line: 13		Type: 1		Id: 125		Symbol: }		]
[Line: 15		Type: 4		Id: 100		Symbol: print		]
[Line: 15		Type: 1		Id: 40		Symbol: (		]
[Line: 15		Type: 4		Id: 100		Symbol: average		]
[Line: 15		Type: 1		Id: 40		Symbol: (		]
[Line: 15		Type: 4		Id: 100		Symbol: aLittle		]
[Line: 15		Type: 1		Id: 44		Symbol: ,		]
[Line: 15		Type: 4		Id: 100		Symbol: aLot		]
[Line: 15		Type: 1		Id: 41		Symbol: )		]
[Line: 15		Type: 1		Id: 41		Symbol: )		]
[Line: 15		Type: 1		Id: 59		Symbol: ;		]

Abstract Syntax Tree

├─var┐
|    └─=
|      ├─L aLittle
|      └─R 4
├─var┐
|    └─aLot
├─if┐
| | └─<
| |   ├─L aLittle
| |   └─R 2
| └─expr┐
|       └─=
|         ├─L aLot
|         └─R 1000
├─else
| └─expr┐
|       └─=
|         ├─L aLot
|         └─R 2000
├─average┐
| |      ├─a
| |      └─b
| └─return┐
|         └─/
|           ├─L +
|           | ├─L a
|           | └─R b
|           └─R 2
└─expr┐
      └─print(
         └┐
          └─average(
             └┐
              ├─aLittle
              └─aLot
              )
          )

simplefastturtle's People

Contributors

mderam avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.