2011-11-30

link expansion options

11.7: adde/outliner/links whose default is
[target replaces current link instead of current page]:

. outlines are like a tree of links except that
instead of the destination replacing the current view
it becomes added to it .
. notice that this is a generalizable link option:
a link would have a default activity,
but by using the context menu, you could select either
{ target replaces current link instead of current page
, target replaces current page
, target lauches in new {window, tab, todo list}
}.

inferred typing

11.12: adda/types/inferred typing:
(reviewing evlan's type system draft)
[@] 11.10.31/news.adda/lang"evlan/
evlan.org describes many addx features
. the reason you want to infer types
is so that you can have an efficient run-time;
if you don't care about that, as when prototyping,
then oop can be checking everything at run-time,
and both the coding and the compile times can be very fast .
. perhaps another reason to infer types
is so that you can warn users when oop might not help?
-- see the obj'c text's explanation of
why you don't want to type everything weakly
(as a pointer to anything);
basically it's because obj'c offers
so much freedom with deferred linking
that the compiler can make only the most general
inference:
if you don't mention a constraint
then the compiler has to assume you need
an unconstrained type for the purpose of
linking to future objects of unknown type .
. prototype developers and even production coders
like oop especially because it lends itself well
to such typeless programming,
ie, specifically avoiding type constraints by
letting the objects themselves decide whether
they understand a certain command .
. when you get into binary operations though,
(ie, pairs of objects -- and pairing is where
the dancing gets interesting )
then typeless programming is not so useful,
so typing is the only way to do what I call oop
(the classic example of oop
is the polymorphic type"number,
a class of subtypes including integers and floats;
ie, integer and floats can be playing well together
only because they are declared as subtypes of
the same type supertype, Numbers ).
Support Wikipedia Support Wikipedia

evlan.org describes many #addx features

10.31: news.adda/lang"evlan/
evlan.org describes many addx features:

. Kenton Varda's Evlan has many addx features;
but, it "(currently has no type system);
and, it died in 2007.10.1, when the author "(got a real job)!

. what first caught my was cap-based security:
Most of today's computer platforms operate under
a fundamental assumption that has proven utterly false:
that if a user executes a program,
the user completely trusts the program.
This assumption has been made by just about
every operating system since Unix
and is made by all popular operating systems used today.
This one assumption is arguably responsible for
the majority of end-user security problems.
It is the reason malware -- adware, spyware, and viruses --
are even possible to write,
and it is the reason even big-name software
like certain web browsers
are so hard to keep secure.
Under the classical security model,
when a user runs a piece of software,
the user is granting that software the capability
to do anything that the user can do.
Under capability-based security,
when a user runs a piece of software,
the software starts out with no capabilities whatsoever.
The user may then grant specific capabilities to the program.
For example, the user might grant the program
permission to read its data files.
The user could also control whether or not
the program may access the network, play sounds, etc.
Most importantly,
all of these abilities can be controlled
independently on a per-program basis.
. the other main idea like addx
is its being a virtual operating system
which runs on top of any other operating system;
via a virtual machine that is the sole access
to the underlying platform's OS .
. by a complete platform,
he means it is not specialized to be
efficiently accessing all of bloated unix,
but to define what it needs,
and then have the vm access what it needs
for impl'ing the Evlan virtual platform .

adda's secure by language idea:
Even better than implementing security in an operating system,
is implementing it in a programming language:
developers are able to control the capabilities available
to each piece of code independently.
Good practice, then, would be to only give each component
the bare minimum capabilities that it needs to
perform its desired operation.
And, in fact, it is easier to give fewer capabilities,
so this is what programmers will usually do.
The result is that if a security hole exists in some part of your program,
the worst an attacker can do is
gain access to the capabilities that were given to that component.
--[. keep in mind that this won't work without
also implementing security at the hardware level;
this is the level where modularity can be enforced;
otherwise, malware could just jump to
what ever code there is with the permissions it needs .
(see qubes doc's) .]
It is often possible to restrict all "dangerous" capabilities
to one very small piece of code within your program.
Then, all you have to do is make sure that
that one piece of code is secure.
When you are only dealing with a small amount of code,
it is often possible to prove that this is the case.
It is, in fact, quite possible to prove
that a program written in a capability-based language
is secure.
[. great to know if your os and every other app
-- that means esp'ly your browser --
are all written in this provable language ? ]

see: Capability-based Security is used in the
EROS operating system and the E programming language.
Also, Marc Stiegler et al.

addx's idea that concurrency is the key
to secure speed:
Evlan has strong support for highly concurrent programming
being a purely functional language,
Where automatic parallelization is not possible,
there are very lightweight threads (without stacks).
Most of today's systems use imperative languages
meant for a single CPU; eg, [written in adda:]
processAll(results#t.type).proc:
for(i.int = results`domain):
      results#i`= processItem results#i
).

. in c, it would process each item in order,
from first to last.
It does not give the system any room to
process two items in parallel
or in some arbitrary (most-efficient) order .
adda aspires to be simple:
It is far easier to remember
multiple uses for a single construct
than to remember multiple constructs.
--[. however he has ada-itis and braggs about
having only 19 keywords;
one of which is "(where)
which could have been said with a reused "(:) .]
interoperability done via compatibility layers:
If and when the legacy software is no longer in use,
the compatibility layers can be removed,
leaving only the ultra-efficient Evlan core behind.
functional:
Because Evlan is purely functional,
no function call is allowed to have "side effects".

. see www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=225
(dead link, is this right: queue.acm.org/detail.cfm?id=864034)?
-- ask google where else that link can be found:

Natural programming languages and environments

Communications of the ACM September 2004/Vol. 47, No. 9
by Brad A. Myers, John F. Pane, Andy Ko
This article presents findings on natural programming languages.
(i.e. natural as in intuitive in the UserCentric way)
It advocates features for programming languages,
that are justified by these findings.
Areas include:
    SyntacticSugar, that causes fewer errors
    (it more intuitive/natural).
    Better integrated debugging-support,
    esp. for hypotheses about bug-causes.
which suggests that humans like to write rules of the form
"When condition X is true, do Y".
I am not yet sure to what extent this will
change the current system, however.
natural programming:
By "natural programming" we are aiming for
the language and environment to work the way that
nonprogrammers expect.
We argue that if the computer language were to
enable people to express algorithms and data
more like their natural expressions,
the transformation effort would be reduced.
Thus, the Natural Programming approach
is an application of the standard user-centered design process
to the specific domain of programming languages and environments.

[at that link is a] good short summary of the
Natural Programming project here at CMU.
We're affiliated with the EUSES consortium,
which is a group of universities working on
end-user software engineering.
google's 2007 Update on the Natural Programming Project
Functional Bytecode
Bytecode for the Evlan virtual machine
uses a functional representation of the code.
In contrast, the VMs of Java and .NET
use assembly-like imperative instructions.
. the GNU C Compiler's "Static Single Assignment" phase
is actually very close to being equivalent to
a purely functional language. [no overwrites]
If GCC does this internally just to make optimization easier,
then it doesn't take a huge stretch to imagine a system which
compiles imperative code to functional bytecode .
--[11.30:
. another contrast to assembly-like imperative instructions
is addm's idea for a high-level interpreter:
instead of translating from an abstract syntax tree (AST)
into a sequence of assembly instructions;
addm, the vm, would try to evaluate an AST . ]
The purpose of constraining variables to types
is to get the compiler to check your work for bugs
and optimize code as well .
. if you could specify that an index to an array
must be less than the size of the array
-- and if the compiler could then check for that --
then buffer overruns (one of the most common bugs
leading to security holes in modern software)
would be completely eliminated.
(run-time bounds checking can prevent buffer overruns,
but then users see your app shutting down unexpectedly).

2011-11-01

bundles obviate folders-first policy option

10.21: adde/fs/mac's bundle idea obviates folders-first policy option:
. instead of having a folders-first policy option,
the file system should be more like
mac's bundle system
where each folder has the option of
declaring itself to be either
a folder or a bundle .
. so then, in a file system window,
folders can be listed before files,
but the bundles are treated like files .

user changes can help with localization

10.23: adde/gui/user changes help with localization:

. there should be a wrench icon
by every command
that leads to this message:
"(if you figured out what this does,
and you can think of a better word in your language,
please do tell by emailing here ...)
even better,
the gui should be editable so that when you figure something
you can give it your own words or icons .
. the program keeps a config file of this,
and every time they change it,
you can remind them that when they
feel satisfied with their gui
they can share it with others
(at this email ...).
. make sure they confirm that their understood language
is in fact what they think they're targeting;
and allow comments that include dialects or locations
that they think it's special to ?

-- source of that idea's inspiration:
news: Software Localization Paradox:
Like any other translation,
software localization is best done by people who know well
both the original language in which
the software interface was written – usually English,
and the target language.
People who don’t know English strongly
prefer to use software in a language they know.
If the software is not available in their language,
they will either not use it at all
or will have to memorize lots of
otherwise meaningless English strings
and locations of buttons.
People who do know English often prefer to
use software in English
even if it is available in their native language.
The two most frequent explanations for that is
that the translation is bad
and that people who want to use computers
should learn English anyway.
The problem is that for various reasons
lots of people will never learn English
even if it would be mandatory in schools
and useful for business.
They will have to suffer the bad translations
and will have no way to fix it.
So this is the paradox
– to fix localization bugs,
someone must notice them,
and to notice them, more people who know English
must use localized software,
but people who know English
rarely use localized software.
That’s why lately i’ve been evangelizing about it.
Even people who know English well
should use software in their language
– not to boost their national pride,
but to help the people who
speak that language and don’t know English.
They should use the software especially if it’s translated badly,
because they are the only ones who can
report bugs in the translation
or fix the bugs themselves.
(A side note: Needless to say,
Free Software
is much more convenient for localization,
because proprietary software companies are usually
too hard to even approach about this matter;
they only pay translators if they have a reason to believe
that it will increase sales.
This is another often overlooked advantage
of Free Software.)
I am glad to say that i convinced most people to whom i spoke
about it at Wikimania
to at least try to use Firefox in their native language
and taught them where to report bugs about it.
I also challenged them to write at least
one article in the Wikipedia
in their own language,
such as Hindi, Telugu or Kannada
– as useful as the English Wikipedia is
to the world,
Telugu Wikipedia is much more useful
for people who speak Telugu, but no English.
I already saw some results.
I am now looking for ideas and verifiable data
to develop this concept further.
What are the best strategies to convince people
that they should use localized software?
For example:
How economically viable is software localization?
What is cheaper for an education department of a country
– to translate software for schools
or to teach all the students English?
Or: How does the absence of localized software
affect different geographical areas
in Africa, India, the Middle East?

Translatewiki.net
. a localisation platform for translation communities,
language communities, and free and open source projects.
-- found by gui translator who refered to
 wikimedia's localizion paradox .
from an Interview with Wikimedia’s Amir Aharoni .

2011-10-31

adda markup's conflicts with ini format

10.25: news.adda/markup/conflicts with ini format:
. bzr (the ubuntu team's distrib'd cvs)
uses an ini folder with the catgories of
[/] and [groups] .
. generally the ini format can
conflict with the adda markup lang's syntax
because it uses brackets as category headers,
and the category name may consist of a single symbol character .

double-equal to mean prolonged equality

10.12: adda/lexicon/==:
. the == could be like the japanese way of
2-trees representing many trees: a forest .
. 2 equals would say the values are
equal for many moments,
ie, they are pointers to the same obj; [10.13:
or they are part of a notify&update pattern .
it could also be used as a special form of
assignment stmt:
whatever you're getting access to,
you have some way of maintaining synchronization,
as would occur if using aliases .]

meta.compiler

10.10: adda/meta.compiler:
. there should be a meta.compiler
that lets you  write a list of
transforms from adda to target lang
and then the meta compiler is
generating the compiler from this list .
. to get started, just make the usual compiler;
and, along the way,
be looking for how to generalize the process;
--
. the first step is to finalize the adda lang,
then write a translation map from general adda
to the simple adda that maps directly to c
(eg, procedures can't be nested ).

types of access constraints

10.5: todo.adda/types of access constraints:
. {rom, wom, xom, xwm} could be the keywords for the
various types of access constraint for
read-, write-, execute-, and write&execute- only-memory .
. instead of having any combo of rwx,
consider that an execute priv'
implies a read priv' .
. the original unix way had in mind
-- in addition to the self, group, world groups --
a sort of 4th group: executives
those whose activities depended upon
what file they opened .
other ideas:
. when does the system need an exe'able permission?
. if that app is an executive,
then it can execute any type it recognizes as exe'able .
todo:
. review previous ideas of
how an obj's name can include access types;
(just as it includes its datatype);
eg, f.txt mean obj"f is type"txt,
so then how does its name explain
access constraints such as (rom vs rwm)
and (in vs out) param types ?

10.21: adda/types of access constraints/intro:
. the fundamental operation of unix
revolves around this:
a user with privilege status of
{owner, member of owner's group}
is applying an app to a file,
if the app and file permissions permit it .
. a file may be located in
either a private or public space:
a private space is usable by
whoever has the owner's key .
. the key holder claims self belongs to a group;
and other users can belong to the same group .
. files can grant separate permissions for
{ owner (what the keyholder can do)
, in-group (what the owner's group can do)
, in-others (what anyone can do)
}.
. an executive is a special type of app
that uses its input data
as the source of instructions it will follow
including the decision of
what it will affect on the computer;
whereas non-exec's will decide their behavior
only from their constant program code,
along with their memory of their previous behavior,
and changes in the machine's state .
. most of these non-exec's are just editors,
affecting at most the files they are given,
some private mem, and the screen buffer .
. files should be tagged executable {xom, xwm}
only if their data is suitable for
instructing some executive .

. a user can be thought of as being
a sort of executive app .
. the user's actual executive power
is determined by which group of app's
the user is allowed to execute
which in turn is determined by
the executive apps' file permissions
and whether the file considers the user
to be {owner, in-group, others}.

. executives can be calling other executives,
just as the user calls them,
so, suppose a called executive
is considered to have the same priviledge
as the {executive, user} that called it;
then, a human user could run a public app,
and when that app tries to access
the user's private files,
this would be allowed .

. the exe'able permission is saying
that if you are an executive
you can read this even if
your caller doesn't have read permission;
likewise,
having a read permission is saying:
you can read this regardless of
whether you're an executive or not .

. so, all of that was the typical
unix permissions scheme;
an alternative is capability based security:

. an app can only access
the files that are within the folders that are
listed in the app's capability descriptor .
. file's and folders, too,
can have a capability descriptor
that can override any app's capabilities .

2011-10-02

window config' generation and automation

9.27: adde/gui/window config' generation and automation:
. once windows are arranged in an oft-used way,
you can generate an icon representing that way,
and have it become available by menu .
. to customize your menu item,
there's a pallet of icon styles:
# a miniature of the current display,
# an abstract view with only window frames,
# and either of the above with
names of chosen apps added to the icon .
. for speedy creation of window arrangements,
there is a window drawing mode,
such that anything you do with mouse
affects only the frames of the windows,
not their content;
so, you don't need to be a sharp shooter
targeting scrollbars or tiny buttons .
. also, the windows are auto'ly tiled,
so your point selections don't have to be exact .
. a mouse-down dragged to another point
makes a rectangle, as usual;
then clicking in the resulting rectangle
brings up a list of frequently used app's and folders;
the default is a finder window .
-- todo:
that reminds how ipad
lets you scroll with multi-touch
maybe they have something for auto-tiling too?
. I remember the mac plus in 1985,
it had an easy drawing app that so inspired me .

2011-08-28

function graph editing

8.4: adde/function graph editing:

. how is audio graphing done?
how is the gui separated from the command processor?

. each unit of mouse movement
practically represents a pixel unit
which then represents a range of data points;
the first of those points can be chosen;
or if there is a sharp spike
then find the high and low
to include every point inclusive;
ie, graph a vertical line instead of a point .

. audio graphing is like strings of words,
but instead of the words differing in length,
they are all on their side for differing height .
. range selections result in a pair of numbers:
the {begin, end} of range,
which are then sent to the processor .
. if the range was possibly modified,
the editor then has to regraph that range .
8.28:
. the editor can handle this without knowing
the particulars of the audio graphing,
because it will have an interface for
generic function editing;
or rather,
the editor and every command processor
will all speak the system language:
the system's language describes
a mathematical function
as either a set of points or a formula
along with a type specification that includes
a domain and codomain;
with an optional subdomain and inverse operator .

2011-07-30

when software capitalists become dictators

7.4: adds/security
/when software capitalists become dictators:
. we see what a mess engineers have made of
the internet and computer security;
as chips make more decisions in our appliances,
they are like new laws imposed upon our nature;
this is where capitalists would be legislators;
and they must therefore submit to our constitution:
ie, representatives are elected,
initiatives can be brought by the people
and laws are open to public scrutiny .
. not only is opensource software not communism
(Bill Gates was misquoted as suggesting this);
but software as private capital
is sure to present an inevitable tyranny
just like a communism will
without the checks and balances of
democracy and separation of powers .

7.15: adds/robot/constitution with context casing:
. one way to balance private and public interests
is by including a context chip,
which has the ability to override other chips
whenever it senses the robot is on public property .
. it would also have final say over
the use of force the public is interested in .

TDD (Test-Driven Development)

web.adds/sw.dev.process 
/TDD (Test-Driven Development):
7.1:
"( my python web app is obs ! )
"( you forgot your TDD unit tests, pal )
. what is TDD?  Test-Driven Development
TDD != Unit Testing Dave Rolsky 2009
7.5: synth:
. in test driven development,
rather than ask "(how to impl this feature?),
we ask "(how do you prove
that a feature is impl'd?)
-- and that drives your interface design
(ie, the tests are designed even before
the interfaces, not just the bodies).
links:
sw.dev.process @ wiki
Xunit options for obj'c

agilepainrelief.com:
 I’ve been on projects where we tried to write
all of our tests after the classes were written.
Our test suite was valuable
 and prevented many regressions.
But it allowed many issues to slip through.
Weaker elements in API’s were often missed
and were changed only at a later date
at some expense.
Tightly coupled code was allowed to evolve
making some elements of the application
very difficult to test
without having to create dozens of
other (often unnecessary) objects.
As a result of all this
it became more difficult to write test cases over time.
Would TDD have solved all of these problems?
Perhaps not but it would have forced us to
confront many of them sooner.  
unit testing vs Test-driven_development
. the unit test tries to verify
all features of a given module;
 tdd (Test-driven development) is about
using tests as documentation:
. assuming you already have
libraries of utilities and datatypes,
you design the interface first
then the tests, and finally the bodies
that will make the tests pass .
. if you are writing your documentation first;
then you won't have any problems with also
writing test harnesses before the app is built .

. this is supposed to complement prototyping:
the developer often needs a semi-working model
to get ideas for a more polished model .
. the prototype is then used as the basis
for a high-reliability app
that writes the final design as a set of
user doc's, unit tests,
maint'doc's, feature tests,
and functional tests (having each function
beginning with precondition testing
and ending with postcondition testing).

. reverting to the last version that passed all tests
may often be more productive than debugging.

instead of relying on platform services directly,
they should be accessed through a wrapper,
so that functional testing can be applied .
--
See dependency inversion principle

including obj'c features

7.23: adda/oop/including obj'c features:

. in the expression"( a`b(x)`c ),
the ( a`b(x) ) means
the object"a has a procedure b(x)
that returns an object location
whose available functions include c .
. the syntax"(a`b) is not necessarily
involving self-modification;
it simply means subprogram"b has access to (a)
as an inout parameter
(the subprogram's object parameter).

. is there some efficient way of doing a`b`c
without passing pointers ?
I was thinking there was some virtual way
that doesn't really need pointers
(oop doesn't really need
all the pointers it thinks it needs)...

. if a subprogram's object param
returns a reference to something other than
the object param,
then in the c translation of same
this subprogram takes a destination param;
ie, a param that inputs a destination address
showing where the caller wants the return placed .

. why wouldn't it always take a destination param
even when returning self? ...
because the caller is already housing that obj .

7.26:
. my original concern here
was allowing the passing of references
and the use of object param's,
just like obj'c oop does,
while still using the sort of oop system
that did not generate garbage .
todo:
. I think obj'c has the convention that
even if ( a`b(x) doesn't return anything
if an object reference is expected as a return,
as is the case in "( a`b(x)`c ),
then it will use a reference to (a);
ie, ( a`b(x)`c ) would equal:
( a`b(x); a`c ) .

protecting the stack limits

7.22: adda/protecting the stack limits:

. how can one test for stack limits per platform?
if you test it once per platform
could the limit become smaller later?
it could depend on number of processes,
and current ram count ?
the user or an error could downgrade ram .
some help from addm:
. one thing that helps the stack problem
is assuming that user programs are addm code
rather than native code;
addm uses the c stack in a very limited way
and puts the user's stack entirely in the heap;
the user does call standard libraries
that in turn are native code;
but these can be designed to conserve stack space
(eg,
all recursive routines are finding some way to
serialize the large jobs;
eg, instead of giving gig's to quicksort,
the sorter breaks the job into mbyte sections,
and gives the quicksort's sections to mergesort ).
...
but can't the user can program natively? yes:
(see adda/natively coded extensions)
the user isn't restricted to addm,
so adda must be aware of some stack limits
and provide protections against overflow .

symbol table linking

7.14: 7.15: adda/symbol table linking:

. etrees (expression trees)
are tree nodes with pointers into
global and local dictionaries of symbols
(symbol tables).
. every etree module
implies access to a global symbol table,
and must specify any needed local symbol tables .
. there can be more than one local symbol table;
because, a dictionary can include procedures;
and, procedure definitions can have
local dictionaries:
the parent procedure becomes the
scope of its local dictionary,
hence the term "(nested scopes),
involving stacks of local symbol tables .
. each module has a tree of symbol tables .
. a typical scope path is:
module/subprog/nested sub/nested block/nested block .

. the 3 main uses of "(library) include
system, standard, and custom .
. the system library of an addx installation
is a service for organizing and linking
the modules that are available for reuse .
. a standard library is a module that is
declared by the system's language .
. a custom library is one added by the user .
. each module has a list of imported modules,
and a tree of symbol tables
to match its tree of nested scopes .

. when designing the pointer that is
going from etree nodes into symbol tables,
there must be an efficient coding,
and it should support efficient copying
even when it involves context changes
(re: adde/object copy & paste).

etree node variants for library symbols:
. there is first a bit to distinguish
symbol location type in {library, local}:
# library location:
. there may be many libraries in use (15-bit),
and many symbols per library (16-bit) .
# local location:
. there's often no more than
4 nested levels of locals (2bit);
and often less than 256 symbols per local (8bit).
but if node`size is in increments of 16bit chunks
that division could be 4 bits for 16 nested scopes,
and an 11-bit space for locals,
or less if the descriminant is more than 1 bit .
[7.30:
... in any case, the more space you save,
the less efficient it is to remap etree nodes
to a new symbol table after a context change .]

details of library location:
. there could be an infinity of libraries over time,
so the library codes in an etree node
don't represent specific libraries,
rather they represent a slot in the module's
list of imported or required libraries;
however, standard libraries can be specified,
since there are a finite number of them;
ie, if the code is in the range that is
reserved for standard lib's,
then that is the same code used by
the system library;
otherwise, we need to use the module's import list
to convert the symbol table's code
into one that the system library recognizes .

. the system library creates a custom lib's code
by taking a Secure Hash of its interface
. as long as that didn't change,
it would be considered the same library . 

natively coded extensions

7.22: adda/natively coded extensions:
. the adda compiler helps turn adda code
into obj'c code,
and then the user plugs that into xcode
to generate mac programs .
. there are 2 styles of user programming:
# extending addm:
. the user want's their library unit to be
seen by addm,
so that user's library unit is callable from
user's other scripts .
. this entails compiling the library unit,
recompiling addm to bind with the library unit
and relinking addm with the entire library .
. this is known as pythonic development:
a module is run as translated vm code
until it's perfected:
then it's promoted to native code
and made available in the account's library .
# building native apps:
. in building a native app,
adda code is translated to the native lang
(eg, mac speaks obj'c & cocoa).
. the native program then imports
the relevant adda libraries
and includes addm as a component
so that the program or its user
can run arbitrary adda scripts .

object copy & paste

7.14: adde/object copy & paste:

. the typical copy & paste
is a char-string operation;
whereas, an object selection
is operating over etrees (expression trees)
which are tree nodes with pointers into
dictionaries of symbols (symbol tables).
. there can be more than one symbol table;
because, a dictionary can include procedures,
and procedure definitions can have local dictionaries;
hence, a single etree can be within
the scope of multiple dictionaries
represented by stacks of local symbol tables .

. a copy becomes a module
meaning it needs its own copy of
any local symbol tables;
however, the cost of copying
depends on the destination:
if the paste location is within the source's scope
it shares all the same symbol tables .
. when some symbol tables are
not shared between source and destination
those tables must be copied;
and, affected etree nodes adjusted
to point into the new tables .

. when an arbitrary substring is selected
it can be representing fractions of etrees,
eg, given a+b+c, a selection can include
all of term-b and partials of terms {a,c} .

. there may be parts of the given language where
partial terms don't have the same meaning;
ie, there would be nothing but a
char-string translation of the object selection .
. in any case,
the quickest, most general way to define a selection
is to get links to the entire chain of symbol tables;
and, copy the entire subtree that contains
all the fragments of the selection;
then include a descriptor that shows
where the selection is beginning and ending .

. when would you want fragments and still want
the etree object rather than a char string?
for orthogonality,
we have to provide for the possibility
that one of adde's plug-in app's
can find some use for such a selection;
ie, in many cases of user interaction
the selection is for a function other than
cut or copy .

7.15:
. when designing the pointer that is
going from etree nodes into symbol tables,
there must be an efficient coding,
and it should support efficient copying
even when it involves context changes .

. both the source and destination of a copy
have scope paths:
if the scope paths aren't the same
we have to identify any scopes not shared
and copy their symbol tables
for merging with the destination .
if this is a cut instead of a copy,
there are fewer choices,
since the destination space is smaller .

. a complication of multiple nestings of scope
is the orphaned symbol from ancestor scopes:
these imply some sort of communication with
a context which no longer exists .
. we have to remind the user
that the orphan's place in the destination
may need special attention:
should it be added to the new parent scope,
or some higher scope ?
. the default location would be relative height,
ie, the same number of scopes up the path
as it was in the source location .
. in any case, we have to assist the user
in keeping track of these orphan relocations,
and make sure that all affected contexts
are adjusted to create a sensible communication
such that, the role of the source ancestor
is now provided by the new context's procedure .

tags, link-trees, and file-trees

7.3: 7.30: adde/tags, link-trees, and file-trees:
. how to integrate tags with folder systems?
placing a file in a folder is tagging it;
 a hierarchy is a tag with segments;
ie, each path name is one tag .
. while a file can be in only one folder,
it can be assigned to many tags .

. tags can be thought of as
a list of links to its members;
and, equivalently, as attributes of a file:
each file or file link can list all the tags
to which it is a member,
just as it can tell the folder path it's in .

link-trees vs file-trees:
. a file-tree is the usual folder tree,
it contains actual files rather than links;
so, a file can be a member of only one file-tree .
. the link-tree is like a file-tree
except it contains only links to files
rather than actual files;
thus, a file can belong to many link-trees,
and may be in many places
within the same link-tree .
7.30:
. the main idea for these distinctions
is that file-trees are low-level concerns;
the only reason they need to be accessed
is when the space limits require
deletions or archiving .
. most file system operations
are concerned only with organizing files,
not managing limited space,
and each activity should have its own
customized view of the file system;
so, most file accesses should be done
through link-trees .
. tags can be applied to either files or links,
depending on the tag's scope:
tags on files are global;
tags on links apply only to
a specific link-tree;
ie, each link-tree has its own set of tags:
both the ones induced by the global tags
belonging to files it's linking to,
and the tags specified by the
user of the link-tree .

binary operation aggregation

7.10: adda/cstr/binary operation aggregation:
. biop's (binary operations)
can be seen as aggregated
by a rule book showing combinations of biops
that should be considered to be
one subprogram call
ie, binding to a particular subprogram;
eg, {?, else} are both biops,
and the rule book would say that
(?, else) is a single function:
?-else(truth,proc,proc).proc
or ?-else(truth,fun,fun).fun .

references for security and speed

7.9: adda/oop/references for security and speed:
. notice how oop would rather
create a new object and modify a pointer
than modify the value of a current object .
. I call this the "(pervasive pointers).

. from an encapsulation view there is no diff',
since only the owning type
can do these mod's .
. what it does seem to uniquely do though,
is encourage the sharing of objects;
ie, if you can modify your value
then I have no interest in sharing its object
because it's no longer synonymous with
the intended value at some past time .
--
. oop is doing for every value
what c does only for arrays .
7.10:
. it does promote strong
capability-based security;
because if everything is through reference,
and ref's are encryptable,
then that is a much stronger encapsulation
unless the system is already protected
by allowing only system-compiled code .
7.11:
. another interesting property of
pervasive pointers
is that by comparing pointers,
one can tell quickly whether
even huge structures are identical;
though if the pointers aren't equal,
they might still represent equal values .
. python has a speed hack where the
first 100 ints have reserved pointers
so in the many loops controlled by small ints,
pointer compares are decisive .

local resource accesses and wrappers

7.3: adda/portability/local resource accesses and wrappers:
. wondering how adda can provide portable features
and yet also provide access to
individual platform features .
. per each platform,
represent its features as a library,
and then map adda's features to that .
. users can expect portability from
staying with the model;
and can get more into their specific platform
by importing the lib's it offers .
. additionally,
there will never be a portable model of
what paths you can modify;
instead, you have to list per system,
what volumes are available,
and whether they are writable or rom .
7.5:
. adda must include all the storage models,
and must map them to diversely contstrained models:
eg, some platform may offer nothing but a database,
so, adda must provide a hierarchical filesystem
that is implemented by a database .

go's defer statement

7.1: adda/go.lang/defer:
. go.lang has a defer
that is like a type mgt's finalization routine
only it's used by a function
for things that should happen on return .
. ideas I got from that are:
# on return: ... [7.30:
. "(on *condition*) would generally mean
rule-based vs imperative programming;
so (on return: s) would add (s) to
the list of things to do before returning .]
# self`end`+ ... [7.30:
. this is modeled after i`+ 1
which is shorthand for i= i+1 .
. the self is the current subprogram;
it already has an "(end)
listing things to do before ending;
and a (`+) would add to that list .]

Ousterhout's dichotomy

7.1: news.adda/Ousterhout's dichotomy:
. John Ousterhout, designer of Tcl,
noticed that high-level programming languages
tend to fall into two groups,
"system programming languages"
and "scripting languages".
[ie you can't have a language that is
optimal for both .
. in defence of that claim,
pypy tried to have a system language Rpython
that was as much as possible like
Python, the scripting lang;
because they wanted
a self-hosting python compiler
ie, one written in python instead of c .
[7.30: like adda,
Rpython is designed to translate into c
for the purpose of avoiding c:
system programmers can use Rpython
yet still take advantage of c compilers .]
. the closest Rpython could get to python
is a subset of it that added static typing;
because, some features that support
coder productivity
are antithetical to features that support
algorithm efficiency .
. Ousterhout was likely pointing out that
scripting lang efficiency was not so important;
because, scripts are glue for
subprograms of sufficient size,
such that most of the run time
is spent in the parts defined by the system lang .
7.30: web:
D. Ancona, M. Ancona, A Cuni, and N. Matsakis.
RPython: a Step Towards Reconciling
Dynamically and Statically Typed OO Languages.
In OOPSLA 2007 Proceedings and Companion, DLS'07:
Proceedings of the 2007 Symposium on
Dynamic Languages, pages 53-64. ACM, 2007(pdf)
. an approach that attempts to preserve
the flexibility of Python,
while still allowing for efficient execution
is limiting the use of
the more dynamic features of Python
to an initial, bootstrapping phase.
This phase is used to construct
a final RPython (Restricted Python) program
that is actually executed.
RPython is a proper subset of Python,
is statically typed,
and does not allow dynamic modification
of class or method definitions;
however, it can still take advantage of
Python features such as mixins and
first-class methods and classes.
This paper presents an overview of RPython,
including its design and its translation to
both CLI and JVM bytecode.
We show how the bootstrapping phase can be
used to implement advanced features,
like extensible classes and generative programming.
   

2011-06-30

enum.typed record domains

6.20: adda/dstr/enum.typed record domains:
. in classic lang's like c,
arrays had very different properties
than records .
. in a polymorphic languages however,
records can be more like arrays;
because, although their components vary in type,
the various types often have the same base type;
eg, all types can print their value, etc .
. and any time a record has at least
2 components of the same type,
it could make sense to specify components with
an expression rather than a literal name,
just as is done for arrays .
today's issue is this:
. in trying to unify the concepts of
arrays and records,
there needs to be a way for records to
express their component names as being
some enumeration-type's subrange;
and then, conversely,
any time a record r declares its components' names,
that should induce an enumeration type:
r`domain
-- I'm using the term "(domain) because
arrays and records are like functions;
and, functions in math are known to
input values from a domain type
and output values from a codomain type;
ie, f: domain -> codomain;
or, in adda:
function f(x.domain).codomain,
array A#(domain).codomain
record R.(r1.co1, r2.co2, r3.co3);
R`domain = {r1, r2, r3};
R`codomain = {co1.type, co2.type, co3.type},

. assume there's the enumeration
e.type: {r1, r2, r3};
how should a record say its domain = e ?

R.(r1.co1, r2.co2, r3.co3);
R`domain`= e ?
[6.23: yes,
that lets the record be defined in the usual way,
and then also say that the domain is
not a new declaration,
but rather a reuse of some existing enum.type .]

mis:
. one thing that wouldn't work is this:
R#(e).{co1.type, co2.type, co3.type} ?
-- that would instead be saying
R is an array of enum;
and each var's possible values
are in the set:
{co1.type, co2.type, co3.type}.
--. this could be useful for when
writing programs that write programs:
many of the values they're concerned about
are parts of languages, including types .