User:Average/SLICK

From HackerspaceWiki
Jump to: navigation, search

Simple Language Interfacing Computers and microKontrollers (SLICK) is a specialized language in development made specifically for hardware projects that have on-board CPUs. It consists of special operators that command and query the hardware, as well as regular general-purpose expressions to allow maximum flexibility. It is an interrupt-driven language so it can respond to different events on your I/O channels. The aim is to create a language specifically for all microcontrollers and even scale to control something like a phone PBX..


STUB

In addition to the standard lexical items in a programming language of expressions (2+3), identifiers (myVar). This language clarifies imperative statements for handling and commanding I/O interfaces into the language. Interfaces are preceded with an ampersand (&). "&P1" indicates pin #1. When it appears on the left-hand side of an equal sign, it means to accept input from that pin and assign the value to the variable on the right. On the right-hand side, it means to query the pin specified and assign it to the variable on the left.

Rather than variable declarations, a dollar sign to the left of an identifier indicates a variable, much like the original BASIC.

Interrupt-driven language, normal sequential execution doesn't need to be an motivation. An ideal first, then see if the hardware logic allows it simply. Program code as a series of code blocks preceded by an inputs on which they run. If more than one code block has the same condition, they are merged into the same code block, unless there more than one microcontroller daisy-chained.?

SLICK specification v.0.1:

Aim for var=[input] {Name: var processing} [output P1]

  • Keywords: set, feedback, goto. "Set" puts the program into non-volatile memory if available. "feedback" sends an arbitrary ASCII string back to the hosting machine.
  • Operators: +,-,/,*, @
  • Delimeters: (), {}.
    • {} sets off a (possibly) named code block. (@(&P1 OR &P2) { do servo things} ServoControl)
    • () orders precedence
  • Names, identifiers
  • Booleans: AND, NOT, OR, XOR ((a OR b) AND NOT (a AND b))
  • Built-In CONSTANTS: HIGH, LOW, ON, OFF

&P1?

Concurrent programming is supported with the idea of many inter-linked boards. Such interfaces there are presumed to be bi-directional and have their own special syntax.

A language for microcontrollers isn't meant to pass around re-useable software components that made ObjectOrientedProgramming popular.

Personal tools