2010-04-30

cross-platform means a deep binding

4.11: news.adda/cross-platform means a deep binding:

summary:
. Apple is disallowing the use of code
that uses an intermediary translation
or compatibility layer .
. the important thing is that when intelligently done,
intermediary translations are no different than
people translating pseudocode to the target language .
. you'll know when it's intelligent
because they won't be able to enforce it .

rationale:
. this rule is just being fair to
dev's that spend the extra time
to get their code designed for efficiency;
Apple is acknowledging how important it is
to be first to market with an idea,
and if people are creating virtual machines
this will make it easy to be first to market
but at the expense of keeping the app' efficient .
. the xcode system will generate code that follows certain rules,
and it would not be easy to quality-check the app'
unless the code is following those rules .

rationale @ daringfireball.net
. what Apple does not want
is for some other company to establish a
de facto standard software platform
on top of Cocoa Touch.
Consider a world where some other company’s
cross-platform toolkit proved wildly popular.
Then Apple releases major new features to iPhone OS,
and that other company’s toolkit is slow to adopt them.
At that point, it’s the other company
that controls when third-party apps
can make use of these features.

co.android alerts dev's to Apple's major change .

daringfireball.net 8 April 2010
. section 3.3.1 of the iPhone Developer Program License Agreement:
Applications may only use Documented APIs
in the manner prescribed by Apple
and must not use or call any private APIs.
. the 4.0 SDK beta now adds:
Applications must be originally written in
Objective-C, C, C++, or JavaScript (iPhone OS WebKit engine)
and only code written in C, C++, and Objective-C
may compile and directly link against the Documented APIs
(e.g., Applications that link to Documented APIs
through an intermediary translation
or compatibility layer or tool
are prohibited).
Steve Jobs explains:
“intermediate layers between platform and dev'
ultimately produces sub-standard app's
and hinders the progress of the platform.”
a response:
. it doesn’t make sense to limit
source-to-source conversion tools like Unity3D
--
unity3d creates a complete XCode project that just works!
. using iPhone Remote,
you can use an actual iPhone or iPod Touch device
to view and test your game live,
right from the Unity Editor. [using javascript on the web]
--
Unity3d's CEO:
. In the ancient days of the App Store (July 2008),
Apple very late changed the kernel to disallow
JIT (just-in-time) compilation.
What we did instead was spend several months
changing Mono to compile scripts
AOT (ahead of time) instead
(this is why some dynamic constructs in our JavaScript
doesn’t work on the iPhone).
my response:
. if Unity3D is disallowed,
at least they are ahead with a source-to-source tool;
now all they have to do is make it a deep binding:
convert their graphics library functions calls
directly into cocoa graphics calls .

4.29:
. the mac#iphone expects code to follow the idioms,
and this is achieved by very intelligent transforms:
adda code -> mac idioms .
. each platform needs its own adda backend;
adda's oop system should not be concerned with
having a shallow binding to various other oop systems .
. adda's front end should turn human ideas into
expression trees that can be analyzed by computer,
rather than using the idioms of a given platform;
and then,
adda's backend for the mac#iphone
should be able to translate human ideas to
iphone`particulars
-- the same way a programmer does
(this is the sort of work lisp was invented for).

4.30: my response after reviewing the issue:

Ludd·ite:
Pronunciation: \App'll\
Function: noun
Etymology: perhaps from Ned Ludd, 18th century Leicestershire workman
who destroyed a knitting frame
Date: 1811
. one of a group of early 19th century English workmen
destroying laborsaving machinery as a protest;
broadly : one who is opposed to especially technological change .
— Luddite adjective .

Air Vehicle c coding standards compete with Ada

4.8: news.adda/av c++ coding standards:

stn vol3#1 p36/c can be safe too!
. while Ada is the technically superior
and more robust language compared to C,
-- where anything can be type-cast into anything,
type-casting was a problem with
hiring college students for Ada coding:
it was seen as an unmarketable experience base .
. reliability issues with C
have been due only to
the way in which it was used;
however,
another possible problem with C
comes at the time of inspection,
when some code reviewers may find Ada
to be more self-documenting .

. the auto industry had a safe-subset standard for c;
and the F-22 used static code analyzer (SCA) tools
to enforce restriction to a safe-subset of Ada 83 .
. with the same idea in mind,
the F-35 Joint Strike Fighter found a safe subset
of both C and C++ for the safety critical systems
developed by the team of Lockheed Martin Aeronautics,
Northrop Grumman Aerospace, BAE Systems
and the F-35 supplier team.
. the F-16 had safety-critical software
that was all assembly coded,
and some of their team helped the F-35 team with
deploying a safe subset of c
-- both c and asm are similarly low-level lang's .

. an SCA tool's analyzer is like an observer
in a pair programming operation:
a much faster way of getting up to speed
than learning a new language like Ada .
--. after reading that,
I wondered how many C cowboys from college
were still banging their head on restricted C ?
(either the 216 new rules in the form of compiler spit,
or a 140 more pages of manual ...).

air vehicle c++ coding standards (doc) (google's cache)
. less-critical portions of Air Vehicle (AV) code
will be developed in C++
(safety-critical portions are to be in C);
the air vehicle c++ coding standards
provide safe, reliable, testable, and maintainable
C++ programming .
. these rules are required for all
Air Vehicle C++ development
and recommended for any
non-Air Vehicle C++ development.
Vehicle Systems Safety Critical Coding Standards for C,
is based on:
MISRA Guidelines (Motor Industry Software Reliability Assoc)
For The Use Of The C Language In Vehicle Based Software,
but is providing a more comprehensive set
of language restrictions
applied more uniformly across
all Vehicle Systems safety critical applications.
. AV Coding Standards build on the
Vehicle Systems Safety Critical Coding Standards for C,
by including:
C++ language-specific guidelines and standards.

. unit testing with full structural coverage
is typically done only at the source level
for non-critical code .
. but since compilation to object code
will result in some structural changes
as high-level control structures
are translated to a maze of goto's,
safety-critical code is also
unit-tested at the object level .
. that precaution has even found
some compiler bugs!

. it may seem more efficient to do Ada's practice
of validating one compiler per platform,
rather than unit-testing every translation;
in fact,
Ada compiler validation
has been for language enforcement only:
any safety-critical code for
military, aviation, [or medical?]
is routinely unit-tested at the object level
regardless of what language (Ada, C, ...)
the compiler was translating .

. from seeing how things went on the F-35 project,
the F-22 maint crew, when switching to new cpu's,
decided to convert their code base from Ada 83 to C .

soon-to-be-Dr. Robb at lockheedmartin.com
--. watch the F-35 do its first vertical landing(video) .

2010-04-01

battery-saving architecture

3.27: addx/batt'saving architecture:

notifications:
. without notification systems or hardware interrupts
ipc (interprocess communication) requires
a polling loop which uses power all the time
just checking for whether anything needs power!
. notifications work by having service agents
tell the os what they are checking for,
and then the os will call them back when it happens .

power-saving mode:
. another needed control system is batt'savings mode;
because, agents can provide
higher levels of service if they know
whether the user has nearby access to more batt's .

. services can vary their levels of service by
putting optional services in a separate thread,
and then marking that thread as optional
which then affects its scheduling priority .
. the user can indicate how much to conserve,
and then the system sets a power.conserve.flag .
. the scheduler can use that flag
to adjust the way it schedules the optionals .

. put all optional work on a todo,
else if it's now-or-never,
tell the user what's not being done
while on min drain mode .
. another option while employing a user agent
is letting the agent handle the annoying,
repetitive questions from a service .

. the os uses the average recent rates of cpu useage
to estimate relative batt'life or work levels .
. the os also considers batt's charge age:
if the batt' is near the end of life,
then optional services should be cut anyway
since being in that state worsens the amount of
batt'drain per work done .

. if the system is working more than minimally,
it can then ask the user
whether they'd rather have more batt'life .
. it could do this with an alert
or an on-going notification (animated icons)
for both work intensity and remaining energy;
but, on some systems,
the remaining energy is not easy to measure .

2010-03-31

llvm and .NET or lisp

3.20: addx/llvm and .NET or lisp:

. how did llvm fit in with .net?
the .net was an improvement over bytecode;
it had a binary format of high-level code
-- call it wordcode --
and any language could compile to that wordcode .
. there's security in the wordcode,
since it's easy to verify it's not malware,
then a platform-specific runtime can
translate wordcode into an exec.file .
. llvm presents itself as the universal asm.code
(source code of a machine instruction set)
so one quick way to roll a wordcode compiler
is to compile wordcode to asm.code .
. then the llvm for that platform
will do all the heavy lifting of
jit-compiling and dynamic morphing
that keeps the asm.code mirrored in
the most efficient version of native code
for the current circumstances .
. there need be no practical difference between
word.code and the etrees of lisp
and perhaps that's why Stallman would
downplay .net as a Microsoft false freebee .
. what we really need from .net
is something more lisp-like
where the only constant to the std
is that etrees describe the conventions
of the current package .
. what we really need from lisp
is the same binary std for word.code
that .net calls assemblies .
. at the moment lisp's std is text-based
not binary -- xml is the same thing:
people should be communicating with that
only as a last resort,
when no binary convention has been agreed upon .
3.23:
. Mono from SVN is now able to use LLVM as a backend .

3.22: addx/security/review:
. what was the system that offered better security than
soa's token-based (smart-carded) logged messaging ?
. how did it differ from virtualization ?
. the first wall starts with using source code
rather than binaries:
. a program is an adda binary
that is then compiled to addx code
which is native code but can access only addx
(assured from being compiled by adda),
and then only addx can access actual devices .
. with this separation of power,
the program can tell addx what it needs
and then the user can tell addx
whether those needs sound reasonable .
. an adda binary is an etree (a parse tree)
where half of the compilation is already done:
. after adda text is parsed into etrees,
the etrees are safely translated by adda
to a system lang for compilation into a native binary .
. in essence the adda program has written the program;
if the original author had
programmed in the system lang'
then it could unsafely have
direct access to the machine .
. this is not unlike the .net security strategy;
but, addx is not concerned about supporting
multiple source lang's . [3.31: nevertheless,
adda's etree could be the target of
some other lang's compiler, for piping:
[your lang] -> adda`etree -> [some adda`backend] ]
. both { .net, adda } have a binary format
for sharing code, but .net's assemblies
may be more thoroughly processed than parse trees .
[3.31: and conversely, parse trees are in a
more modifiable, machine-comprehensible state
than .net's assemblies .]
. the ideal situation is to translate adda etrees
directly into llvm code,
but the easiest way to build addx in a portable way
is translating adda etree to the source text
of the language that the target platform prefers;
eg, when on the mac, the target language is
c, obj'c, and the cocoa framework;
while on linux and elsewhere,
it would be c, c++, and the qt framework .

. on the Android OS, the main source of
security is a slow vm
that compounds the speed hit caused by
addx's security not allowing
direct access to anything;
addx is asking every cross-module communication:
"(who are you,
and do you have permissions for that?)
. then if addx is to run dynamically modified code,
it's running a vm within a vm,
and things get even slower!

. the .net idea of security is much faster
than any vm security (even Dalvik)
but perhaps that speed
would come at the cost of space
-- the Android fits within 64mb .
. or,
perhaps because of patents,
any open system that was like .net
would not be easy to defend .
. the primary reason I'm not bothering to check
is that .net's idea is not nearly as simple as mine!
. you can avoid a lot of low-level programming
if you just learn the target's high-level language,
and do a simple lang-to-lang translation .
[3.31:
. actually what .net is essentially doing is
unpacking assemblies into etrees,
checking them the way adda would,
then translating them to
the etrees of some native compiler,
and compiling them dynamically .
. it's that dynamics that gives it the name .net;
that's the basis for dynamically accepting code
from other websites in a safe way .
. it may not need to get low-level,
but translating between etree formats
is definitely more complex than source-to-source .]

soa (service oriented architectures)

3.22: web.addx/soa/openware options:
. I was really impressed by the bright ideas
in the book "(soa for dummies);
is there any openware project that embodies
or further documents those ideas? .

3.22 .. 3.23:
bk.addx/soa/Its Role in Your Connected Systems Strategy 2004:

. this 2004 article assumes soa starts with
a common language that we agree on in advance .
. we've seen businesses on the internet
agree on xml,
but that language should be used
only for the handshake,
which asks:
"(what binary language do you speak;
something more efficient than wordy xml? ) .

. reviewing what I learned in "(soa for dummies),
you design an soa sytem by arbitrarily choosing
a common binary language for your messaging system .
. then you provide a converter for each of your programs
that will translate between their command language
and your system messages language .
. a fundamental requirement of soa
is token-based (smart-carded) logged messaging,
where every interaction leaves a paper trail
so that while maleware can happen
it is always discovered, and the source known .


3.24: bk.addx/soa/token-based security

. make web services secure:
"(. use token-based security:
an STS [Security Token Service] that emits
SAML tokens that can be cached on the client
(like kerberos token but with open standards).
Your webservices can be secured with
the wsFederationBinding
and you can do access checks based on
saml assertions that contain claims.
. here's a post that shows a web client
but it applies to smart clients as well .)
. wiki`Security_token .

Web Services Trust Language:
"(Web Services Trust Language (or WS-Trust)
defines extensions that build on Web Services Security
to provide a framework for
requesting and issuing security tokens,
and to broker trust relationships.
WS-Trust describes:
1. Methods for issuing, renewing, and validating security tokens.
2. Ways to establish, access the presence of, and broker
trust relationships.
CICS supports the February 2005 version of the specification )

WS-Trust specification:
CICS can interoperate with
a Security Token Service (STS),
to provide more advanced authentication:
An STS is a Web service that acts as a
trusted third party
to broker trust relationships between
a Web service requester and provider.
In a similar manner to a
certificate authority in an SSL handshake,
the STS guarantees that the requester and provider
can "trust" the credentials
that are provided in the message.
This trust is represented through the
exchange of security tokens.
CICS acts as a Trust client
and can send two types of requests to an STS.
* validate the security token
in the WS-Security message header;
* exchange the security token for a different type,
enabling CICS to send and receive
from a wide variety of trust domains,
such as SAML assertions and Kerberos tokens.
. use SSL to secure the connection
between CICS and the STS.
. the meat: an open soa security std .


3.24: addx/soa/efficiency and accountability:

. security is slow because it involves
carding for permissions and logging uses;
therefore, the os applies security only to
accesses of obj's it deems are
critically in need of protection .
. the dev' too, can be asking for protection
of particular obj's, types, or type classes .
[3.26:
. the os`security is protecting the user,
while the dev`security is asking the os
for help with organizing large projects;
security helps find where the bugs originate .]
. logging interactions and param's
can determine a crash's cause
amidst multiple authors or products .

. copying is minimized to make logging cheap:
msg's from task queues are
requeued on the log's queue,
so then only a ptr is copied per instruction .

logging timestamps:
. in a strictly modular system,
a concurrent system may not need
to log a msg's {creation, executed} timestamps
in order to assign blame during a system problem;
[3.26: but,
it might be helpful, so it should be optional .]

3.25: sci.addx/soa/saas (sw as a service):
. may be keyword for soa token:
security done at the local level
rather than the web (where each process
also has its own processor) .

3.26: lib.addx/soa:
docs.oasis-open.org/ws-sx/
www.oasis-open.org/committees/tc_cat.php?cat=soa
www.oasis-open.org/committees/tc_cat.php?cat=security
. SCA Client and Implementation Model for C language.
. Service Component Architecture (SCA)
defines a biz model using a soa,
based on the concept of Service Components .

3.27: addx/gemini kernels:
look at this viral load:
> I just received a notification
> that I have used over 10GB of data this billing cycle,
> which is unusual (as I haven't been doing anything ...)
--. there should be
even in a monolithic system like linux
a gemini system, where a supervisor system would be
untouchable even by root
and this sup' would give you an honest reading
of things like the traffic you're generating .

GPL high-priority list

3.30: news.adds/openware/priority list:
fsf.org campaigns priority:
. FSF high-priority projects list
serves to foster the development of
projects that are important for
increasing the adoption and use
of free software and
free software operating systems .

software patents

pos.adds/software patents:
3.28: [my position pro-patents]
. I've heard Richard Stallman be
reasonable about patents,
explaining that the real problem with them
is an underfunded patent system
that doesn't bother to sort out
what's a complex of prior art works
from what is truly worthy of a patent .
. work that took so long to develop
surely would be more worthwhile to simply license
rather than trying to reinvent it!
. good patents, licensed fairly, could increase
the nation's productivity dramatically .

3.29: patent protections for the masses:
Open Invention Network®:
. an intellectual property company
that was formed to promote Linux
Patents are available royalty-free
to any company, institution or individual
that agrees not to assert its patents
against the Linux System.
. USPTO (US Patent and Trademark Office)
now features a “Peer to Patent” process
that lets the public submit advice
for issuing or invalidating patents .
Linux Defenders
. eliminates bogus software patents
by implementing the work of the
Open Invention Network® .
. contributors to open-sourced patents
may freely use Linux Defenders'
defensive publication processor
and the Defensive Publications database
which contains patented openware searchable by
patent and trademark office examiners
around the world .

. the Linux Defenders program enables anyone
to efficiently contribute to:
“Defensive Publications”
where you can enter your openware inventions
into a db that will be searched by the patent office
so if there are no prior patents,
there will be no future patents on similar inventions .
“Peer to Patent”:
supplying the USPTO with evidence of
prior art invalidating the claims of
pending patent applications.
“Post-Issue Peer to Patent”:
supplying prior art to support the invalidation
of previously issued patents .

meeting Android OS and Dalvik VM

3.26: summary:

. android as a subtopic of addx
is concerned with how androids ideas
could contribute to or be reused by addx .
. of immediate interest is their vm,
which is significantly more efficient than the java vm .

. some are upset by the changes it made to linux
while others call it a refreshingly clean architecture;
the body language of the google staff who were
defending the changes indicates that a lot of
compromises had to be made in order to appease
the various business-related needs
of the other oha (Open Handset Alliance) members .
. it's still an open platform,
but users can only modify their system as root users
-- a line crossed that can void their contract .
. unlike the Apple app'store model,
there is nothing in the Android model
that would conflict with addx`goals .

3.19: web.addx/android:
. wiki's android .
. some app dev's call android a gutted linux .

thoughts of an android system engineer:

Matt Porter was heavily involved in the MIPS and PPC ports of Android:
"(Android is not Linux in the strict sense of the word
because important userspace components are missing,
thereby making Android comparatively inaccessible and inflexible.
Android uses, for example, its own mount system
that works with MMC subsystems out-of-box
rather than with USB devices.
Support is missing for udev, glibc, and
SysV process communication,
but are replaced by a somewhat hard to change,
hard-coded implementation from the Open Handset Alliance.
. Android makes no use of tslib for touchscreen support
and lacks effective Ethernet support.
[More arguments are included in his set of slides.]
Second, the Android community is
lagging behind other Linux and open source communities,
partly because the platform is commonly developed
outside the Android Open Source Project (AOSP) tree
and given less priority in the open repository.) .
Harald Welte summarizes Matt Porter's critique:
"(. google has simply thrown 5-10 years
of Linux userspace evolution into the trashcan
and re-implemented it partially for no reason.
Things like hard-coded device lists/permissions in object code
rather than config files,
the lack of support for hot-plugging devices (udev),
the lack of kernel headers.
A libc that throws away System V IPC
that every unix/Linux software developer takes for granted.
The lack of complete POSIX threads.
Just one more practical example:
You cannot even plug a USB drive to an android system,
since /dev/sd* is not an expected device name in their
hardcoded hotplug management.)
. Android's design is defended:
"(Android's specialized and inflexible character
was a result of performance and resource reasons.)
. the android userspace sounds pretty tight;
what's it like for the dev'ers? [3.20:
. those concerns were by app dev's, not users!
they are crying about not being able to use
the usual linux tool chains to dev' for linux .
. it's likely that dev'ers are not accustomed to
having big brother defending the consumer
by creating so much burden for the sake of efficiency
and security -- the sad fact is
that linux is a malware magnet just like windows
exactly because
those platforms let dev's have their way .]

. Android is now owned by the Open Handset Alliance
where google is just one of many members;
the oha has an interesting page showing
all the roles in the communications industry,
and all the players in controlling Android .

lecture of why Android is based on a new vm:

. libraries written in C and other languages
can be compiled to ARM native code and installed
by using the Android Native Development Kit (NDK) .
The NDK converts c to bytecode not the cpu's native code
Simply re-coding a method to run in C
usually does not result in a large performance increase
but does always increase application complexity.
The NDK can, however, be an effective way to
reuse a large corpus of existing C/C++ code.
--[. if c is not your favorite lang,
it would apparently be best to adapt your
translator: adda -> android's java
rather than: adda -> c for android's ndk .
3.20:
. but how much "(complexity) are we talking about here?
creating an adda compiler for a completely new language
is itself a significantly complex problem .
]
. as per the usual security measures
android distinguishes the app dev'
from the platform (system) dev' .
. only the system dev's can make good use of
Java Native Interface (JNI),
a programming framework that allows
byte code running in a Java VM
to call and to be called by cpu's native code .
--[. this is the same trade-off
that the iphone os had to make:
you could allow app' dev'ers to write native code
but then require them to
submit their code to human inspection
and risk having it rejected by hooded judges;
or,
you could do it the android way:
let anyone come without inspection
but then keep them tied up in a rather slow vm .]

Native classes can be called from Java code
running under the Dalvik VM
using java's System.loadLibrary call .
Unlike most Java VMs that are
stack-based, running Sun`java bytecode,
and having problems with concurrency,
the Dalvik VM, with a new byte code set,
is register-based, and is designed to
efficiently support concurrency .

. the new vm is optimized for platforms having
small ram, no hard drive, and a slow cpu .
. total ram on many platforms
is projected to be limited to 64mb;
and, app's typically have only 20 mb to play in .
. the system lib is 10mb --[ steep learning curve
but allows reuse of a lot of code .]
. by having a large library of native code
there's reduced need for jit,
because each bytecode instruction
represents many lines of highly-optimized native code .

. java's jar.files arrange all info within
the class it belongs to;
whereas [Dalvik EXecutable] files (dex.files)
contain the same info but arranged for
maximal sharing, with segments for vari'data,
and sharing of constant's in these segments:
string, type, proto[function signature], field, method .
. using that organization,
dex.files, even when uncompressed, take up
less space than jar files, even when compressed .

. cpu speeds in phones are expected to be
250 .. 500 mhz, bus speed is 100 mhz;
with a 16..32k cache .
types of mem:
( clean: unmodified
. dirty: modified -- app's structs and heaps
. private: accessed by only one process
. shared: accessed by multiple proceses .
)
. {clean vs dirty} mark bits are kept separate
instead of being embedded with each obj .
advantages: reduces cache misses,
avoids unsharing and padding needs;

. an android app's install-time work
is the same as ada's compile-time work:
time for a lot of verifications and optimizations .
[3.26:
. this is done with the desktop dev'tools,
not on the mobile unit itself .
. the toolchain converts java lang'
to java vm byte code (.jar)
and then converts .jar's to android vm bytecode .]

. being register-based avoids instruction dispatch:
30% fewer instructions and code units,
35% more bytes per instruction
but it can fetch 2 bytes at a time;
eg, compare jar's vs dex's for this code:
sumarray(arr#.int).long:
( sum.long=0
; for (i.int in arr) sum`+ i
; return sum
)
. java bytecode does this in
(25 bytes 14 dispatches 45 reads, 16 writes)
. android bytecode does it in
(18 bytes 6 dispatches 19 reads, 6 writes) .

. humans can interact at 10..30 reactions/s
and expect video at 25..30 frames/s,
audio sync'd at 10 times/s .
. calling those times the human scale,
contrast that with computer scale:
just handling human interaction takes
far less than 1% of cpu's capacity .
. mobile devices run on tiny batteries;
so, your app should be going back to sleep
rather than staying in a loop,
and when it does loop,
some loop`heads are more efficient than others;
they show you a list of loop head coding styles
and their impact on cpu time (battery life).

. why base app dev'ing on the java lang?
much of openware work is done in that;
and, there are compilers for many other lang's
that will translate to java classes (jar.files);
android has a tool that can convert these jar's
to android's bytecode (dex's)
-- but they don't do that dynamically on the handheld,
so the jython idea is out .
[3.26:
. a twist of the language question would be
why use the java lang but then toss the java vm idea ?
. the really progressive idea is llvm:
a tool that converts llvm code to your vm's bytecode .
--. Apple's clang project translates obj'c to llvm;
the llvm community is then translating llvm to
a variety of cpu's, including mac's x86 .]

[3.26: llvm`backend for android`Dalvik
Patrick Walton
Date: Fri, 09 Jan 2009 22:04:16 -0800
Subject: Type safety of the Dalvik VM?
. I'm interested in writing an LLVM backend for Dalvik
(allowing C code to be compiled to Dalvik),
Certainly, the apparent lack of type safety
makes it easy to write a C-to-Dalvik compiler,
but I want to make sure that my methods won't depend on
exploiting bugs that are going to be fixed.
"Andrew Stadler (Google)"
Date: Fri, 9 Jan 2009 22:11:09 -0800
. make yourself very familiar with the bytecode verifier,
which runs over all java bytecode
before it gets to the actual Dalvik VM,
and provides expected the safety checks .
fadden
Date: Sun, 11 Jan 2009 10:34:41 -0800 (PST)
. type safety is a goal, and in some cases
Dalvik is safe to a greater extent than other VMs
(e.g. it's more picky about the width of sub-32-bit integers).
Some details are available in dalvik/docs/verifier.html.
Identifying type-safety issues during verification
allows us to avoid making those checks at runtime,
improving performance. Because DEX files are read-only
to everything but a couple of system processes,
we can (usually) do the verification
at app`install-time, and not have to repeat it
at app`startup-time.

--. it sounds like the best bet is to find llvm ->java vm .

David Roberts 2009
JVM Backend
I've written a backend for LLVM
that allows LLVM IR to be transformed to a Java/JVM class file

2008: only “foreign” language to run on Android is Scala .
Invoke JNI based methods (Bridging C/C++ -> Java)

Developing using C++
StephC
Date: Tue, 13 Nov 2007 03:53:17 -0000
Local: Mon, Nov 12 2007 8:53 pm
J2ME is a real nightmare for mobile games developers,
it's even considered by many as the reason why
mobile games aren't really suceeding so far.
John Carmack, a game developer:
"(It turns out that I'm a lot less fond of Java
for resource-constrained work.
I remember all the little gripes with Java's language,
like no unsigned bytes,
and the consequences of strong typing, like no memset,
and the inability to read resources into
anything but a char array,
...
Even when compiled to completely native code,
performance is hobbled by Java semantic requirements
like range checking on every array access .)
]

the whole truth

3.19: adds/the whole truth:
. the whole truth, nothing but the truth,
and easy to access:
. contrasting given info with
any popular myths it contradicts
(making sure intended overwrites
are not merely appended in reader's mind).
. pointing out how the given info
when known by you
will add value for us .
(the free capitalist principle) .

moore's law riding concurrency

3.15: news.adds/turing award for gui's inventor:
. he's been working on modern interfaces
from the alta, to the apple`tablet .
. looking for better handwriting and vocal parsing:
it has good chance of being improved with parallelism .
2009 Charles P. Thacker
For his pioneering design and realization of the Alto,
the first modern personal computer, and in addition
for his contributions to the Ethernet,
and the Tablet PC.

ladyada.net`openware

3.15: web.adds/ladyada.net`openware:
. I heard of ladyada in a makezine;
she also sells kits for the designs she gives:
. one of her mit eng'ing projects
was a cell-phone jammer (not available as a kit!)
. she has an [ask an engineer].page
"(Our weekly LIVE video chat. Every Saturday 10PM ET )

3.15: web.adds/dangerousprototypes.com`openware:
. her saturday vid chat was spammed with this:
dangerousprototypes.com
-- A new open source hardware project every month
eg, a web platform kit for $35, assembled for $5 more.
The Dangerous Prototypes web platform is a tiny server
designed for networked hacks where a full PC is inconvenient.
for projects that bridge the internet to microcontrollers,
but most of them have a PC in the middle to handle network stuff.
This business card-sized internet appliance
can connect to web services,
control physical objects from a browser interface,
or email sensor status reports;
no PC intermediary required!
. owner ian also has:
http://www.diylife.com/bloggers/ian-lesnet/
eg, computer-mouse-salvage

3.15: co.adds/forums.adafruit.com/ergonomic keyboard kit:
. posted in kitbiz / ergonomic keyboard kit:
. thinking about questions to ask,
I'd like to buy an open source kit for
ergonomic keyboard kit:
. I was hoping someone would open-source
an ergonomic keyboard kit
with one or more of these features:
it comes in 2 parts that communicate with each other
as if one keyboard .
. it has a set of macro keys that are programmable by
reading an sd card's text file .
. the sd card can hold your passwords securely,
so macro keys could send long passwords .
. some cable that converts a laptop into a keyboard;
so that another computer thinks it's just a keyboard,
when really it's a set of programmable macro keys as well .

openware lego cad

3.14: web.adds/openware lego cad:

LDraw is a file format and parts library
. for modeling Lego creations in 3D on a computer.
LDraw models are created with a CAD tool
and displaying can also be done with
POV-Ray, a free 3D ray tracer.
. ldraw.org is a community supporting LDraw;
. they have a getting-started page for mac,
and a list of available tools .
. the LDraw library can be downloaded from ldraw.org
but some of the LDraw editors include it too .

* Bricksmith is an openware LDraw editor for Mac OS X .
* Ldglite is another Mac openware LDraw editor;
but it uses an OpenGL rendering engine,
making it portable to other operating systems.
* LeoCAD, is an openware LDraw editor for {Windows, Linux}
with a perspective camera.
. only the downloads are at g'code;
the source is at gerf.org .

adde's security

3.23: adde/security:
. how does user data remain private
when that privacy depends on not having net access,
but then it can still access another program
that does have net access ?
3.31:
. app's are not communicating directly;
rather, they message each other and the internet
only through the os, addx,
and this arrangement offers several tools:
. only isolated app's connect with the net .
. app's that contact both the net and the user
can raise an alert to check that app's
trust settings .
2313:
. all user input goes through the user`agent,
which can assist in protecting user privacy .

3.25: adde/security/networking controls:
. after reading about flash being
a complete programming language
I wondered how adde can protect the user
without bugging them ?
. does the current design already take care of this?
the only time it matters that a program
communicates with its home site
is when it also has access to local personal data .
. for an app like an editor that also has
a pane that needs web access,
the program could come as a package of 2 modules:
the edit.module wouldn't have web access,
and the web.module wouldn't have files access .
. the editor pkg would provide suggestions for
how to arrange the panes for each module,
but adde and the user would have final say over that .
3.31:
. adde is checking the module capabilities
so as to enforce trust settings .

3.27: adde/multi-casting:
. from a dev.android thread:
"(I'm pretty sure that's not possible to
generate a broadcast event when the alt key is pressed,
instead of letting the current application consume it.) .
. part of special permissions should include
app's or services explaining that they are sniffing input
from what you would think is going to the app in focus .

debug feedback mgt

3.9: adde/debug feedback mgt:
. code gives warnings by writing to a debug file;
if the debug file is modified,
then the user is warned that the app authors
may be misusing some of their subsystems;
and users are then given the ability to
send a debug report .
. what should not happen,
is having unhelpful subsystem warnings
written on the user's screen .

user-mapped gesturing

3.23: adde/multitouch and gestures:
. most of those 2-finger gestures of multitouch
could also be done with one finger;
you just need a convention like up-swipe is zoom-in,
and down is out .
. with single-finger swipes
we could avoid most of those annoying little control boxes .
. there are cheap track pads for most platforms,
and they offer the same thing as a touch screen .
. gesture controls should also have the mvc architecture,
where the users can customize the mapping
from gestures to actions,
so they can do what makes sense to them .
. with the ability to see the strokes they draw,
then even if the app' they're on is hesitating to respond,
the gesture's visual overlay is always quick to
give them graphic feed back .

3.23: adde/themes that are user-controled and snappy too:
. one reason mac doesn't like to change its themes
is to keep things snappy,
implying all rendering needs to be in the kernel;
but you can customize and have snap too
by keeping the feedback lightweight .

key to portability is sourcecode binding

3.30: adda/key to portability is sourcecode binding:
. dalvik-vs-mono:
"( J2ME was always crippled by the phone vendors
who never wanted to get important APIs into the stack
so that they can bind the developers to
their implementation.)
. what they are calling an implementation
is simply all that boring translation work;
the first thing you have to do on a new platform
is make a backend for your translator
that will map your preferred language
to their version of library calls .
. this is why having a source-to-source translator
is the most efficient way to portability .
3.31:
. it requires a lisp-like infrastructure
that makes it easy to automate all the rules
that one usually applies to programming;
ie, translating from pseudocode to the target code .

function type's literal

3.30: mis.adda/dstr/function type's literal as @:
. just as #.t is the array type's literal,
the function should have something besides ()
because then how do you say function's type
symbolically rather than literally ?
isn't it tacky having manditory useless paren's?
. the @ is english's symbol for function application,
so then @.t could be function type's literal .
then to define the arg type symbolically,
say rec.type: (v.t, ...),
you have @rec.t or #rec.t .
. but then you'd expect
f@x
whereas the english expectation from email syntax is
x@f .

the number-mark as subscript

3.29: adda/dstr/syntax/# as subscript:
. noticing #().t -- the array type's literal --
may not sit well with the idea that
the #-symbol would be interchangeable with
the subscripting of what comes after the # .
. to be consistent with math,
array typing would have to be described
the same way that functions are:
A: i`type -> return`type .
3.31:
. arrays differ from functions in that
a function includes as part of its value
the domain set that is addressing its codomain .
. arrays by contrast, are a list of values,
and the addressing scheme is associated
like so:
. I could have A and B both assigned
to the same value: (1,2,3);
and A could be type #{a,b,c}.n,
while B could be type #{x,y,z}.n;
ie, their values are the same type;
whereas, 2 such functions would not
have the same value: one is { a:1, b:2, c:3},
while the other's value is { x:1, y:2, z:3} .

mem'mgt's array range checking

3.26: adda/mem'mgt/array range checking:
Java requires range checking on
every array access
. that must be a misunderstanding,
one reason you would set limits on
for-loop var manipulation
is so you could check the array access just once
during the first entry instead of every re-loop ?
. I was worried about how to
efficiently do range checking
but my segmented memory idea is not efficient anyway!
. it's an array of 256 ptrs to
data arrays of some small size like 4k,
the bits are divided so that the high 8bits
will address the ptr,
then the lower bits will address into the data array .
. perhaps this is a bit too low level to commit to;
instead,
you program to a higher interface,
and then let a mem module of the translator
try out various strategies for mixing ideas about
segmented mem with other ideas like
copy to allow array growth .
. either way, the lang' I'm mapping to is c,
and that requires me to explain
just how I avoid alloc'block bounds errors .
. modular arithmetic does seem the way to go;
eg, if the platform allows
unsigned rollovers of only certain ranges,
then that range is the size my
alloc'd blocks need to be .
023:
. another cool way is to give every process a 16bit range
from which all its blocks come from,
and then that process can
completely scramble its own space
but at least there will be interprocess modularity .

portable translation the pypy way

3.26: bk.adda/Self-Sustaining Systems:
Self-Sustaining Systems: First Workshop, S3 2008 By Robert Hirschfeld, Kim Rose
. pypy offers a model-driven approach
to language implementation:
unlike jython, which diverges from cpython,
pypy is providing a pil (pythonic intermediate lang')
which can then have a backend to every other lang;
ie, the compiler is translating as if
that lang were a cpu intstruction set .
. pypy doesn't try be the intermed'lang for all back ends .
. it has versions for
high level (oop'ish) langs -- eg, {cli, jvm, js} --
and low level langs: eg, {llvm, c} .
. by coding your translator in pypy (Rpython)
you can debug it on the batteries-included cPython system
and then have all these back ends it will run on
-- including c .
. great, now if I could only love python!
3.31:
. this presentation assumes jython diverges
simply because it's rendered in a
different code base;
but jython differs for a deliberate reason:
it didn't want to just be another python
that happened to be runnable on a jvm,
it wanted a lang customized to complement the jvm;
whereas, cpython wants a lang that is
basically customized to complement ms`windows .

xml modeling

3.26: adda/xml modeling:
. the basics of xml started with
putting "(br) -- line break -- in angle-brackets;
because, angle brackets classically mean
a formal parameter,
as seen in language syntax diagrams .
. this formalism was required because
-- despite their being a standard for text --
there was no unambiguous representation for
line structure: { cr, lf, cr-lf, line's char count } .
. another (incidental) property was that
angle brackets were separating text that was
not meant to be taken literally;
and, this was the basis for
extending the use of angle brackets
for any text that was not to be taken literally .
. the basic structure of {sgml, html, xml}
is to have a pair of angle brackets for
each opening and closing element .
. using that way, there's a restriction on
literal text containing angle brackets;
whereas,
with a parenthetical method (described next)
there's a restriction only on
un-paired parentheses, and the use of the
code-starting symbol: [!]
which can be chosen to be both
very rare in literal text
and easy to write, read, and find .
. the math-english way would have made use
of parenthetical symbols:
{literal text ...}
[!]
block-name( parameters,,, ):
(
{literal text ...}
)-block-name
[!]
non-block ( parameters,,,)
{literal text ...}
3.31:
. the lisp way is slightly more compact:
{literal text ...}
[!]
(block-name parameters,,, :
{literal text ...}
)-block-name
[!]
(non-block-name parameters,,,)
{literal text ...} .

syntax for sets, powersets, bags, lists, hypermatrix

3.25: adda/dstr/literals:
. when a var is of type set,
it really means its values are a
powerset of some given enum type.
. another approach is using {a | b | c | ...}
to mean a value space,
while {,,,} means a set that involves multiple values .
. let dots do hyper-matrix structuring:
( ,,,; ,,,; . ,,,; . ...)
while in set braces, dots delimit items in a bag:
items in a bag are not ordered but duplicates are allowed;
eg, { 2 . 2 . 3 } is the bag of primes for 12 .
vs list { ;;; } which has duplicates but is ordered .

an interface's value literals

3.25: adda/type literals:
. a full adt description needs both a
set of operations
and a set of value literals .
. definitions of type enum are listing
just the values
because the set of operations are from
the scalar.class,
which by definition include certain operations:
relationals (equality, inequality),
assignment, and functions for expressing values as
an integer or string:
ord is the value's place in scalar order;
val is the numeric encoding of the state;
image is the graphic view of state
-- typically a character string
but can also be an icon:
. every graphic icon has a title (a filename),
and many images have nothing but a title;
eg, to describe the state of color,
you'd use the name of the color without necessarily
mapping it also to a colored block image .
[3.31:
. perhaps the most natural way to show in an interface
that a set of symbols are the type's value literals,
is to express them as the return values of the function:
image()
-- understood to return the type's value literals:
`image.{ v1, v2, ...} .
`val.{ n1, n2, ... } could then show
by correspondence with image,
the mapping of images to codes (assuming val was
contracted to be part of the interface) .]

typedef syntax vs terminology trade-offs

3.25: adda/oop/classes vs types:

. if using 2 keywords for defining class vs type,
the class could mean a type that is an
adt (abstract data type),
so then one could replace the type`def's
angle brackets (used for an interface literal)
with a simple enclosure
since a class`def would always be an interface,
and would therefore no longer need a variety
of enclosures; eg, t.class: (,,,) .
3.30: adda/dstr/nominally typed structs:
. another way to avoid various enclosure types,
is to use typing of parentheses:
(.braces ,,,), (.set ,,,) .

. any reason to reserve the terms"{class, classwide}
for the way ada uses the concept of class-wide ?
[3.31: adda uses class-wide semantics universally ]
. notice the english meanings of
"(what type) vs "(what class),
or "(typical) vs "(classical) .
...
. a good reserved meaning for "(class) vs "(type),
is when dealing with generics,
eg, the class of scalars
includes many enum.types .
3.27:
. generally, the meaning of "(class) within the
field of logic -- the origins of oop nomenclature --
is a set defined by a predicate .
. a class can include many types,
and for many reasons .
. the type.classes of interest to oop and generics
are those where membership is defined by
shared interfaces .

multi-interfaces

3.24: adda/multi-interfaces:
. just as oop classes have different interfaces for
clients vs subclassers,
adda needs a sublanguage for describing
multiple interfaces
and the various actors that can access them .
. dimensions for having separate faces include:
roles, security levels, priorities,
business arrangements (eg, cripple.ware vs full-service),
and partner name (where the degree of allowed reuse
depends on which partner is doing the reusing ).