Development driven by constraints
Language specification
- Positional arguments should not be callable as named
arguments. This would make an argument's name a
part of the public interface. Changing the name afterwards would
thus be a breaking change.
- The order of named arguments should not matter.
- Named arguments and dictionaries should be unified.
- Automatic partial application or automatic
currying should not exist, as this would disguise argument
count errors.
- It should be ergonomic to use tables and dictionaries
together with string formatting or string interpolation.
- Private global variables should be possible.
- Private class and object fields should be possible.
- The syntax of nested expressions should mix different kinds of
brackets in order to increase readability. Moss does this quite well
with a mixture of parentheses, square brackets, braces and keywords.
- There should be no index operation for iterators. This would
confuse iterators with arrays and thus lead to subtile bugs.
- The syntax
f[a]
for functions means, iterators
need to check the number of given arguments, as iterators coincide
with functions with no arguments.
- The function
len
should not be defined for
iterators. This would confuse iterators with arrays and thus
lead to subtile bugs.
Object system
- Destructors should be possible.
- The function
type(x)
should return null
in case x
has no type. Otherwise it cannot be used
for type guards in general. For the same reason, x: T
should return false for every object T
if x
does not implement the operation.
Implementation
- A new object on the call stack should have
refcount==1
. For example, if A()
computes a
large matrix, then A().map(f)
and A()+B
etc. do not need a memory allocation, because the buffer can be
reused. Rust offers get_mut(this: &mut Rc<T>)
,
make_mut(this: &mut Rc<T>)
and try_unwrap(this: Rc<T>)
. Thus, as a further
implication, ownership of Object
is needed, because
&Object
does not allow access as
&mut Rc
. However, matrix types have an inner
Rc
of the buffer, therefore it suffices to check
strong_count
, which needs only &Rc
.
Pixel graphics
- It should be allowed to draw to more than one buffer.
- It should be allowed to draw relative to a position.
- There should be at least one good monospace bitmap font in all
sizes from one size to doubled size, containing the standard sizes
for 60 ppi up to 160 ppi. For minimalism it should be stored as a
matrix in a raw buffer, i.e. in the PGM format. Each font file
should contain at least the first 256 Unicode code points. A font
file containing just the first 256 code points should be
arranged as 32*8. — Currently an adaption of Vera/DejaVu Sans
Mono is used.
- The font loader should also be able to load GNU Unifont.
Vector graphics
- It should be allowed to draw to more than one buffer.
Some alpha blending and anti-aliasing techniques need
intermediate buffers.
- It should be allowed to draw relative to a position and scale.
- Buffers with floating point color depth and alpha depth should
be available.
- Colors and alpha values should be given as floating point numbers.
- There should be convenience functions to convert between
color spaces.