Code Monkey home page Code Monkey logo

plasma's Introduction

$ whoami

Hello! I'm Antonio, a Software Engineer, DevOps engineer, and Hacker from Colombia. Here are some highlights about me:

  • ๐Ÿ”— Checkout my Portfolio
  • ๐Ÿš€ I have a strong passion for low-latency solutions.
  • ๐Ÿฅท Information security and horizontal scaling are at the forefront of my concerns.
  • ๐ŸŽ† My personal endeavors mainly revolve around networking, cybersecurity, DeFi and automation.
  • ๐Ÿค I'm always keen to contribute to projects that align with my values and beliefs.

shorier-trophy

๐Ÿ› ๏ธ My tools ๐Ÿ”ง

Go Docker kubernetes jenkins gh-actions hackthebox svelte js

๐Ÿฑโ€๐Ÿ’ป Maybe we cross paths at HackTheBox

htb

Stats related to my work

langs shoriwe stats

๐Ÿค” What kind of projects you will find here?

You will find a proxy, a programming language, a custom function distribution library, python hacks, cool school projects and the list goes on and on. In resume Cool stuff made with passion

Contact

LinkedIn

plasma's People

Contributors

shoriwe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plasma's Issues

Documentation

  • Add documentation for the language in the wiki section.
  • Add documentation for the language interoperability with Go in he wiki section.
  • Include examples.

Feature: Cap magic function

Is your feature request related to a problem? Please describe.
Add a new function for arrays, tuples and hash called cap which calls the underlying slice or map cap

Describe the solution you'd like
This should create two new functions, one internally and the other externally to objects.

obj.__cap__()

cap(obj)

Update documentation

Update documentation:

  • Update project description
  • Add release binaries
  • Magic methods
  • Default symbols
  • How to embed
  • API functions
  • How to extend the language
  • New statements
  • New binary operators

Feature: Negative array/tuple index

Is your feature request related to a problem? Please describe.
Plasma right now only supports positive indexing of value inside arrays, negative indexing should work the same as described by python

my_array = [0, 1, 2, 3]
my_array[-1] # Should return 3

Describe the solution you'd like
Add a condition in array/tuple index function to transform negative indexes to positive indexes

Bytecode

Compile the last IR to a byte array that can be passed to a virtual machine

`delete` statement

Delete statement is a special keyword that internally remove symbols in case a expression or selector is given, in case of index expression the special methods __del__ of the object is called

Thread safe virtual machine

A thread safe virtual machine can be shared in a program without the use of mutexes or any sync operation.

Characteristics:

  • Share the same internal symbol table between all calls
  • Values are also thread safe, meaning the user can operate with them without being afraid of race condition them
  • Context based meaning each time a plasma program is executed a new context is created

Simplified VM

The simplified VM will hide all the low level plasma operations to a simpler user friendly API:

Expected methods:

  • NewVM: creates a new virtual machine
  • vm.Execute: executes the precompiled bytecode
  • vm.ExecuteString: compiles a program string and then executes its bytecode
  • vm.Load: Loads Go created objects to the VM
  • Compile: precompiles a plasma program to a bytecode slice

`is` binary operator

is binary operator is used to check if the class that a value has is the same as the targeted one.

Internally it is equivalent to:

my_value.__class__() == MyClass

Lowercase stdlib

Lowercase all the standard library and magic methods to be consistent and mnemotechnic friendly

`defer` statement

defer statement works similar to the Go defer statement, calling a function at the end of other function body

Documentation

  • ToValue/FromValue Documentation
  • Add new magic functions

Syntax check pass

The syntax check pass will check that:

  • defer, return and yield are only inside gen and def
  • break and continue are only inside for, until, while and do-while

`implements` binary operator

Implements binary operator returns true if the class of value is a target class or if any of its bases is or implements the class

Support struct functions with `ToValue`

Is your feature request related to a problem? Please describe.

Map Struct function to Plasma Objects

Describe the solution you'd like

Using reflection, also scan for the functions of an struct an map them to the plasma object

Simplify AST pass

This pass will return a new IR called AST2 that will be in charge of simplifying this AST1 nodes:

  • Unary and Binary expressions to selector calls
  • Parentheses to expressions
  • for and until to while loops
  • unless and switch statements to if statement
  • unless one liner to if one liner
  • return and yield multiple results to single result (expression on 1, and tuple on multiple)
  • Literals to nodes representing directly the types

Feature: Len function

Is your feature request related to a problem? Please describe.
Stop the usage of the magic method __len__ by creating a wrapper that also could call low level function to return the length of the underlying object.

Describe the solution you'd like
The API of this new len function will be:

len(obj) # returns an integer with the length of the underlying object

Improve interoperability API with Go

  • Improve the developer experience of interoperating the language with existing Go code.

This could be made by applying some kind of facade structure on top of the module to easy the work pipe

Better REPL experience

Features:

  • Color print errors
  • On not none last value result, print value
  • Control-C kills the running statement
  • exit function that exits the REPL

Types unique methods

String and Bytes:

  • join
  • split
  • upper
  • lower
  • count
  • index

Array:

  • append
  • clear
  • index
  • pop
  • insert
  • remove

Int and Float:

  • big_endian
  • little_endian
  • from_big
  • from_small

Transformation AST2 pass

This pass will generate a new IR called AST3 in charge of transforming and simplifying most of AST2 nodes:

Feature: Reserve memory for arrays, tuples and hash

Is your feature request related to a problem? Please describe.
Create a new function that will let the end user reserve memory for arrays, tuples and hash maps.

Describe the solution you'd like
The new API should look like:

obj.__reserve__(size)

reserve(obj, size)

Prettier README

The readme should include:

  • Description
  • Logo
  • Quick language example
  • Quick embed example
  • Quick extend language example
  • Link to contribution guidelines
  • Code quality badge
  • Go version badge

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.