Skip to content

Releases: vihanb/TeaScript

TeasScript 3.1

28 Jan 06:00
Compare
Choose a tag to compare

The Compile-Time Feature Update

TeaScript 3.1 mainly brings compile-time featurse

  • Keys, Small keywords which provide custom compile-time options
    • q key, which aids in quining
    • p key, which aids in polyglots
  • Definitions. Compile-time code variables
    • \a=3.14*xs[0];\a will compile to: 3.14*xs[0];3.14*xs[0].
  • Bug Fixes yeah, and a ton of them. I can declare TS3.1 stable

Examples

Quine:

[q|

Polygot (Python + TS):

"[p|'Hello, World!']";print"Hello, World!"

Definitions:

x\p=*3.14\+yp

Outputs: x*pi+y*pi

##Upcoming features:

  • ? midway bracket closing
  • Fixed arity functions! This will be a monumental feature add will probably be in TS4
  • sed-style replacements: x~/a/b/replaces a with b.
  • Auto-golfing

TeaScript 3

28 Dec 04:08
Compare
Choose a tag to compare

After days of constant development, I've finally finished and deployed TeaScript 3. Currently experimental features will arrive in v3.1 but there's a lot that's new.

  • Real docs! That's right real documentation at ReadTheDocs, that I'll actually maintain.
  • Finally Smart Property chaining
    • For the first time, TeaScript is not limited to the variables it can automatically chain
  • Custom RegExp literals
    • Within RegExp literals, custom additions can be made
    • Custom character classes
  • Compiler rewrite
    • The TeaScript interpreter has been rewritten from the ground up and now is sooo much smarter.
  • Better debugging mode
    • Now debugging mode is more detailed and shows each compiler step
  • Finally centralized sources
    • Finally, the props.json is external and all files are read from Github directly
  • The @ operator which expands to (q,r,s,t)=>q.
  • String automatically close
    • "foo becomes "foo", same with RegExp literals
  • Automatic parenthesis closing
    • Parenthesis automatically close at the end of the file
  • Sooo many bug fixes

Features that missed the cut and are still experimental these will ship in v3.1

  • Operator overloading
    • Use ^ for repeat and power
  • The ? operator
  • Auto-golfing

TeaScript 2

24 Dec 19:24
Compare
Choose a tag to compare

This is the final release of TeaScript 2. Near the end of TeaScript 2's development, I stopped development but I've been working on a TeaScript 3 that will be coming-out soon. TeaScript 2.3 brought many new features and also many new built-ins, I'm not going to list all of them here. Most changes here are just major bug fixes.

Many features also went back and forth but eventually some features such as [0] becoming 0, were just too buggy to be used. Major features that were added:

  • Revamped loops
  • Getter implementations
  • More unicode shortcuts
  • Better . insertion

TeaScript 3 will solve world peace, end world hunger, settle all wars, and a bunch of other great things, so hopefully I can get that out soon.

TeaScript 3 alpha

25 Dec 04:34
Compare
Choose a tag to compare
TeaScript 3 alpha Pre-release
Pre-release

I'm excited to release TeaScript 3! :D TeaScript 3 is the biggest TeaScript update since TeaScript! One of the main original problems of TeaScript was a lot of syntax clues. TeaScript 3 does away this with an efficient, 3-level parser.


TeaScript 3 generally brings changes in the parser / code-generation

New Lexer

TeaScript 3 has a completely revamped parser redesigned from the ground up. Existing TeaScript programs should still be compatible


The new lexer in TeaScript follows the following steps:

  1. Balance Quotes
  2. Handle Unicode Shortcuts
  3. Expand Properties
  4. Auto parenthesis insertion
  5. Balance parenthesis.

New Syntax

  • Auto Parenthesis Insertion
  • Smart unicode shortcuts
  • Auto-quote insertion
  • Smart decompression / compression
  • Perfected property names

The line format is:

Original Code
Parser Run 2
Parser Run 3

Parser Run 1 is excluded for various reasons.


Parenthesis Balancing

The first new syntax is the fact that parenthesis are (almost) not needed (see [what's missing?](# What's Missing?))

xT2,3
x.T(2 ,3 
x.T(2, 3 )

Perfected Property names

Property names are perfected and now don't need .:

xLvC1
x.L.v.C(1 
x.L.v.C(1 )

How to use

Included is solely and only the TeaScript parser. You can simply plug this in to the legacy interpreter. This converts the TeaScript into JavaScript so the only things not included is the environment generation, transpiration, and evaluation.

beta/teascript3.es6.js is used for development of TeaScript. Use beta/teascript3.js (auto generated production ready).

This will provide a function TeaScript, which takes in a single argument for Code. This will output an object (JSON) with the format:

{
    "steps": {
        "strfix": "<Parser Run 1>",
        "reps": "<Parser Run 2>",
        "parenfix": "<Parser Run 3>"
    },
    "Error": "<Error Data, blank if none>"
}

steps.parenfix is the resulting JavaScript code which can be directly passed to INF.code within the TeaScript interpreter.

What's Missing?

A few features are buggy or not implemented them so I've excluded them from the alpha release:

  • Quote Balancing
  • Auto parenthesis insertion

TeaScript 2 beta

16 Nov 03:19
Compare
Choose a tag to compare
TeaScript 2 beta Pre-release
Pre-release

Not long after the original TeaScript release. TeaScript 2 is out! This brings significant changes, especially to the way you work. TeaScript 2 beings a complete rewrite to the original code and brings a safer, faster execution environment, and also smarter compilation code.

  • A very shiny new interpreter
    • Automatic golfing, which is extremely awesome and helpful
      • Betcha none of the other golfing langs have that
    • Automatic documentation. Documentation info is generated directly from the props.json file
  • String Compression!
    • Compress (even small) strings with new L methods. (L.d and L.c)
  • Built-in byte counting
  • Better debug / error handling
    • See your compiled code
    • See exactly where errors originate
  • Full support for unicode shortcuts.
    • Supports encoding and decoding with UTF-8 and ISO-8859-* (Latin-1).
    • Condenses up to 7 bytes of code to just 1 byte
  • Centralized props.json.
    • Easier, more manageable and flexible way to add properties
  • Centralized macros.js.
    • One place and implementation for all macros, functions, and getters.
  • INF object which contains compile time data and other information.
  • Improved environment generation. One of the biggest changes.
    • Environment generation is now automatic, and does not require hardcoded paths thanks to props.json
    • Environment generation is now done in a secure, scope.
    • Environment generation now writes to INF, and returns meaningful errors
    • Environment generation now uses safer configurable methods
  • Improved error messages
    • Any errors during intermediate compilation, transcompilation, or interpreting now return much more meaningful and helpful error messages.