<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang/source/state, branch master</title>
<subtitle>Experimental Forth-like stack language implemented in D</subtitle>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/slang/'/>
<entry>
<title>Play around with a vector type</title>
<updated>2019-04-15T22:12:37+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2019-04-15T22:12:37+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/slang/commit/?id=908d8f01d5e964971ad76909c0ec31468ee93d2d'/>
<id>908d8f01d5e964971ad76909c0ec31468ee93d2d</id>
<content type='text'>
Using _vectors_ as fundamental datatype could make for a really neat experience.

Imagine e.g.:

* fundamental arithmetic operations that apply to both vectors and scalars
* implicit component-wise or vector-wise operations
* scalar values as 1D vectors
* higher order functions to manipulate those vectors
    * `map` function that applies a (quoted?) word to all vector elements and returns the result
    * efficient parallel operations
* a rich library of vector manipulation functions
* or even: matrices as a fundamental datatype?
    * problem: probably harder to conveniently enter via a 1-D repl
* sound more and more like a RPN version of APL…

Back to reality, here is what this prototype actually adds:

* new `DList!int` based datatype alongside the existing int, string and bool types
* basic support for printing such values in a readable fashion
* new fundamental `:` word that constructs a vector of two elements
    * `1 2 :` yields `[1, 2]`
* adapted `+` and `*` to support component-wise operations
    * `1 2 : 3 +` yields `[4, 5]`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using _vectors_ as fundamental datatype could make for a really neat experience.

Imagine e.g.:

* fundamental arithmetic operations that apply to both vectors and scalars
* implicit component-wise or vector-wise operations
* scalar values as 1D vectors
* higher order functions to manipulate those vectors
    * `map` function that applies a (quoted?) word to all vector elements and returns the result
    * efficient parallel operations
* a rich library of vector manipulation functions
* or even: matrices as a fundamental datatype?
    * problem: probably harder to conveniently enter via a 1-D repl
* sound more and more like a RPN version of APL…

Back to reality, here is what this prototype actually adds:

* new `DList!int` based datatype alongside the existing int, string and bool types
* basic support for printing such values in a readable fashion
* new fundamental `:` word that constructs a vector of two elements
    * `1 2 :` yields `[1, 2]`
* adapted `+` and `*` to support component-wise operations
    * `1 2 : 3 +` yields `[4, 5]`
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent definition nesting</title>
<updated>2017-04-16T11:37:23+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2017-04-16T11:37:23+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/slang/commit/?id=20b916b3c90828028c4e981dea06696c23998cf1'/>
<id>20b916b3c90828028c4e981dea06696c23998cf1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Extract variable management, move into `state` package</title>
<updated>2017-04-16T11:17:22+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2017-04-16T11:17:22+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/slang/commit/?id=44f419264898f84fe5536f3ea159c18b381e6083'/>
<id>44f419264898f84fe5536f3ea159c18b381e6083</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
