Code Monkey home page Code Monkey logo

kindscript's Introduction

KindScript - A kinder JavaScript experience

Build Status

KindScript is a platform for creating special-purpose programming experiences for beginners, especially focused on computer science education. KindScript's underlying programming language is a subset of TypeScript (leaving out JavaScript dynamic features).

The main features of KindScript are:

  • a Blockly-based code editor along with converter to the text format
  • an ACE-based text editor with enhanced, robust auto-completion and auto-correction
  • extensibility support to define new blocks in TypeScript
  • an ARM Thumb machine code emitter
  • a command-line package manager

Build

First, install Node (http://nodejs.org/). Then install the following:

npm install -g jake
npm install -g tsd

To build the KindScript command line tools:

tsd reinstall
npm install
jake

Then install the kind command line tool (only need to do it once):

npm install -g kindscript-cli

After this you can run kind from anywhere within the build tree.

To start the local web app server do kind serve within the root directory of build tree (where this file sits) and then browse to http://localhost:3232

TODOs

package mgr + compiler

  • image literals

  • code in top-level scope

  • only compile what's needed

  • don't emit unused global vars

  • testFiles: [ ... ] in yelm.json

  • class methods

  • constructors

  • disallow direct references to class members (cannot copy JS semantics)

  • optional arguments

  • default arguments

  • +=, -= etc

  • += on strings

  • proper caching for x.f++, x.f += ... etc

  • function f() {...}; control.inBackground(f) in local scope

  • function f() {...}; control.inBackground(f) in global scope

  • //% shim=... weight=... help=... etc insteaf of {shim:...}

  • bit operators (&, |, etc)

  • use "(x + y) | 0" etc instead of "x + y" in simulator

  • do not generate empty action bodies for shim

  • check on compiler performance (1000ms on lang-test0)

  • forever() seems to have issues

  • skip unreferenced globals when initilized with literal

  • foo${bar}baz

  • x ? a : b

  • x as T support

  • check on ("foo" + true)

  • simulator at sim-microbit.kindscript.net

  • ptr-<username>-* as the main way publishing packages

  • lambdas returning values (maybe just works?)

  • clear variables when they get out of scope to limit memory usage

  • allow use of floating point for non-native targets

  • do not DECR no-closure functions

  • after uninstall pouch db throws 404 after reload

  • in simulator currResume start loop() in nextTick

  • enum support without enumval= (esp for non-hex targets)

  • switch() statement support

  • % operator

  • error for 'shim:foo' (ie. shim=true)

  • lib compile mode - no reachability, test shims

  • inline assembly

Bigger items

  • generate .d.ts from .cpp
  • generate .d.ts from simulator code
  • debugger hooks
  • auto-fix of parenthesis
  • integrate TD converter
  • think about package versioning (semver?)

Maybe

  • virtual methods
  • 3-way merge upon sync
  • class field initializers (?)
  • support Enum.X + 0 etc ?

web app

  • make blocks output file read only
  • do not type-check while auto-completing
  • scroll completion window with keyboard
  • indent when entering first character on a line
  • save source in hex
  • Save json
  • Drag and drop load
  • Link up simulator
  • Flag to hide from TS auto completion (eg: set sprite property with enum)
  • add markdown processor for docs
  • help for specific arguments
  • stepping debugger
  • attaching runtime warning to specific lines of code or block

converter from TD to TS (different repo)

  • multi-line strings into backtick literals
  • use bit operators for bits.XYZ
  • fish out {shim:...} and friends
  • {hints:...} -> @param x Blah, eg: 100, 200 (?)
  • async is flipped
  • use expr as Type not <Type> expr

License

MIT

kindscript's People

Contributors

mmoskal avatar pelikhan avatar thomasjball avatar tballmsft avatar msftgits avatar

Watchers

James Cloos avatar Yan Lin Aung 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.