Coder Social home page Coder Social logo

justinhuprime / stacklang Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 4.6 MB

Stack-based interpreted programming language inspired by Racket

Home Page: https://justinhuprime.github.io/StackLang/index.html

License: GNU General Public License v3.0

C++ 98.08% Makefile 1.92%
programming-language interpreted-programming-language stack-based-language toy-language language interpreter postfix-languages

stacklang's Introduction

StackLang Programming Language

A stack-oriented programming language with an interpreter implemented in C++. This language is heavily inspired by the HtDP xSL teaching languages and HP's RPL.

StackLang is a toy language intended mainly to explore the interesting (lack of) grammar in RPN languages. While prefix (Polish notation) and infix languages require many parenthesis to make order of operations unambiguous, postfix languages do not. The downside, however, is that postfix languages cannot have variadic functions. Additionally, the decision was made to avoid the use of grouping operators as much as possible. This leads to quoted commands and the need for an eval-like primitive. Grouping of commands together for control flow is mainly accomplished through the use of quoted, locally defined, commands acting as thunks.

StackLang is written by Justin Hu. See the contact info in the documentation pages.

Additional contributions by Bronwyn Damm, Jacques Marais, Ramon Rakow, and Jude Sidloski

stacklang's People

Contributors

justinhuprime avatar slosk avatar wyndro avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stacklang's Issues

Inconsistent treatment of decimal places

Description
Decimal places are not displayed consistent with significant figures.

To Reproduce
Enter commands 5 2 divide, produces 2.

Expected behavior
Expected 2.5

g++ bug when compiling stackElements.cc for release

Describe the bug
g++ warns of overflow assumptions when simplifying parseLevel conditionals in stackElements.cc, in the method SubstackElement::parse

To Reproduce
Steps to reproduce the behavior:

  1. make clean
  2. make release
  3. See the compiler warning.

Expected behavior
Expected no warning to be sent regarding overflow assumptions

Screenshots
screenshot from 2018-07-31 23-25-59

Additional context
This is a known g++ bug that has not yet been resolved.

Recursive functions error

Description
Recursive functions are either segfaulting or redefining internal definitions

To Reproduce

  1. Run stacklang with no flags
  2. Enter
10
sequence
  1. See error

Expected behavior
Expected to produce << 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 >>

Environment

  • OS (and version): Ubuntu 18.04
  • StackLang Version: 2.0 alpha
  • Compiler (and version) used to build: g++-8

include can't handle comments in substacks

Description
include can't handle comments in substacks

To Reproduce
Steps to reproduce the behavior:

  1. Run stacklang and include a file that has the following text:
<<
1
;comment
2
>>
  1. See error

Expected behavior
Expected << 1, 2 >>

Environment

  • OS (and version): Ubuntu 18.04
  • StackLang Version: 2.0 alpha
  • Compiler (and version) used to build: g++-8

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.