Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

2015-05-30

2013-12-25

Parython is a #ParaSail version based on #python

11.22: news.adda/co/Parython is a ParaSail version based on python:
. a recent ParaSail article mentions Parython, (sources)
more on that earlier? yes but just a mention:
Achieving parallelism and safety at the same time
by eliminating rather than adding features
has worked out better than we originally expected.
One of the lessons of the process has been that
just a small number of key ideas are sufficient to
achieve safe and easy parallelism.
Probably the biggest is the elimination of pointers,
with the substitution of expandable objects.
The other big one is the elimination of
direct access to global variables,
instead requiring that a variable be
passed as a (var or in out) parameter
if a function is going to update it.
Other important ones include
the elimination of parameter aliasing,
and the replacement of exception handling
with a combination of more
pre-condition checking at compile time
and a more task-friendly
event handling mechanism at run time.
So the question now is whether
some of these same key ideas
can be applied to existing languages,
to produce something with much the same look and feel
of the original, while moving toward a much more
parallel-, multicore-, human-friendly semantics.
news.adda/co/ParaSail at oopsla:
. parasail is featured at recent oopsla:
# bringing value semantics to parallel oop,
# parallel tutorial with 
decomposition and work-stealing  .

#stackless #python dis- #continuations

11.20: news.adda/stackless python/dis-continuations:
Christian Tismer 2000:
. this paper presents an implementation
of "Stackless Python" (a Python which
does not keep state on the C stack) .
By decoupling the frame stack from the C stack,
we now have the ability to keep references to frames
and to do non-local jumps.
This turns the frame stack into a tree,
and every leaf of the tree can now be a jump target.
While exploring this idea,
we will recognize ordinary function calls and returns
to be just special cases of so-called continuations, ... .
why should stackless be popular?
. the maximum recursion level would be a user option
and not a limit set by C's stack .
There would be pickleable execution states;
that means you can save your running program
and send it in a file to another computer
where it can continue running .

2013-08-31

extension modules

19: 21: adda/extension modules:
. Python' C interface has 2 uses:
one face simply models python
(for calling python from c),
whereas the other face is for writing extensions:
calling c from python .
. the primary purpose of adda,
on the other hand, is to avoid C:
all extension modules are written in adda,
and then adda translates that to C,
like what Cython is doing: Python to C .


2012-11-17

go vs python from the trenches 2012

8.22: news.adda/go vs python from the trenches 2012:
Graham King:
Would I be happy working with Go as my
main language? Yes, I would.
It’s a joy to work with,
and I got productive very fast.
Am I using it instead of Python
for all my new projects?
No, There are two reasons for that.
Firstly, it’s a very young language,
so library availability is limited
(for example, I need curses).
Second, well, Python is just so amazing.
[but] I see the benefit of static typing.

If I was still doing Java, or (heaven forbid) C++,
I would invest heavily in Go.
It was designed to replace them, and it does that well.
Go’s sweet spot is building servers.
(it makes concurrency safer and easier)

Other claimed benefits of Go over Python
are that it’s faster, and it’s “better at scale”.
For some things I’ve done
Python has been faster .
[and] The biggest difference [in speed]
is probably [just] in how well I write the code.
[also] nothing I do is CPU bound.
The “better at scale” argument doesn’t really apply
to building web apps with Django.
We scale by adding servers,
and [Django supports programming-in-the-large
with small self-contained ‘apps’ ]
Steven (March 6, 2012 at 23:22)
You can get pretty close to a REPL
[an interactive Read-Eval-Print Loop]
with goplay, [a web-based go compiler]
-- instead of interpreting, it compiles
[ go was designed for very fast compiling .]
Go is possible to daemonize.
You could use a sync.WaitGroup
to make main wait for any number of goroutines to exit .
But more directly, you can do the same thing by
adding this to the top of your program:
defer runtime.Goexit()
write CPython extensions with Go:
. goPy with gccgo .
Once the libraries and command-line tool are installed,
the "gopy" command-line tool
is generating the necessary C interface code;
and, then using gccgo will compile the code
into an extension module.

2012-09-23

CP4E hero Bret Victor

9.8: news.adde/light table and bret victor:

. Bret Victor's video has a cp4e mission
and shows off the new tools he's built
that help us develope our creative ideas .

. amazing what he's done;
he has an IDE where you can click on any var,
and it turns into the widget needed to adjust it;
but then it's also
re-running your code after every change;
so, if your program generates a picture,
his scripts are custom GUI's for
painting particular classes of pictures
where you paint by both coding
and by adjusting code parameters
-- all by GUI! (as you do edits,
the page is sprouting widgets to help you).
. when you slide a for-loop var,
the program is re-running for every
value in the for-loop's change range
which is causing an animation effect
-- a new way to experiment with video .

. even more amazing,
this IDE creates a complete mapping
between the subpicture being drawn
and the line of code that drew it;
so clicking in the picture
causes the editor to highlight a line of code,
and conversely, selecting a line of code
highlights the subpictures it drew .

. now, speaking of animation,
the next thing needed for visualization
is to create trails for specific subpictures,
so that as you modify a parameter,
it immediately shows how that is affecting
the path of the trail .
. first he's pausing at the
end of the interesting time interval,
then he's using rewind to get to the
beginning of his time interval of interest;
and finally when he's adjusting parameters now,
for each new parameter change,
it's drawing a new trail specific to the
time interval of interest .

. why are there symbols in a schematic?
because it's the easiest way to pen them,
Victor notices ( and there's the icon effect
-- creating instant recall of the concept );
but now that schematics are in computers,
we should be using their dynamic expression:
so, in an electronics diagram,
we could replace the symbols with
little videos of the analog signals
that are generated at that symbol's node .

. likewise, computers can make coding so easy
that any one can do it;
indeed, it seems that the best coders
are just those who are best at
imagining a computer's working internals,
but we have the computer to do this for us,
so why don't we?!
. for example he shows another IDE,
this one being tuned for coding instead of drawing
in which the editor has 2 areas:
on one side is the code,
and on the other is a simulation of the code;
ie, the simulation has a list of all the locals
that are so far declared in your function,
-- and it does this in real time:
eg, as you write the function's header,
the simulation shows the parameters as undefined;
then you can modify the simulation
by instantiating any undefined variables
(so the assignment happens only in the simulation,
not your code), and then as you have code
assigning a complex expression to a var,
the simulation tries to eval that assignment;
and, this way you are testing as you code
-- every time you hit enter,
it's relaunching the build&run
for per-line-of-code testing (quick!).
. if you add a loop to your code,
then all the var's being affected by the loop
are placed in a matrix
with vars in the columns,
and iterations per row (or vice versa).

. he then gives us a history of people who
had a passion for using computers to
help people with making full use of their brains;
pointing out that this work is important because
people need these dynamic tools
to unleash their full human potential .
. he was especially impressed at
those who made computers child's play;
and reminded the audience's budding techies
that we can choose as our identity
to have a social conscience,
and not just a technical expertise .

pioneers of cp4e:
(computer programming 4 everybody)

# Larry "nomodes.com" Tesler:
. not just the developer of copy&paste
but the one realizing we could do better than
obstructive modal versions of copy&paste:
he recognized a wrong
that was unrecognized by the culture .

# Doug Engelbart -- enabling mankind:
. propent of realtime human-computer interaction
not just the inventor of the mouse:
he wanted to solve mankind's urgent problems with
computer-assisted knowledge workers .

# Alan Kay -- enabling children:
. everything he did for windows, menus, and oop,
was to enable children to be computer literate
to make them more enlightened adults!
. he studied those who studied how children think,
in order to help them use computers .
[. in 2006, Kay's Viewpoints Research Institute
was funded by USA's NSF for the proposal:
Steps Toward the Reinvention of Programming:
A compact and Practical Model of
Personal Computing as a Self-exploratorium [pdf]
(see comments of it:
. they critiqued him for bucking the trend of
taking advantage of cheaper hardware
by filling it with more features and bling;
but ironically, that attitude
still hadn't been able to provide all children
with a computer that would help them learn
-- children's computers need to be
as cheap as calculators;
but instead we insist on continuing to
code above the child's price point .]

# Richard Stallman -- freedomware:
. the king of fighting to change culture
for the good of mankind .

9.8: web: i-programmer.info`
Alex Armstrong 10 March 2012`

A Better Way To Program
This video will change the way
you think about programming.
The argument is clear and impressive
- it suggest that we really are building programs with
one hand tied behind our backs.
After you have watched the video
you will want the tools [that he has] demonstrated.

We often focus on programming languages
and think that we need a
better language to program better.
Bret Victor gave a talk that demonstrated
that this is probably only a
tiny part of the problem.
The key is probably interactivity.
Don't wait for a compile to complete
to see what effect your code has on things
- if you can see it in real time
then programming becomes much easier.
Currently we are programming with
one arm tied behind our backs
because the tools that we use
separate us from what we write and what happens.
Interactivity makes code understandable.
Moving on, the next idea is that
instead of reading code and understanding it,
seeing what the code does is understanding it.
Programmers can only understand their code by
pretending to be computers and running it in their heads.
As this video shows, this is incredibly inefficient
and, as we generally have a computer in front of us,
why not use it to help us understand the code?
...
if you watch just one video this year
make it this one.
Update:
See Light Table - a Realization of a New Way to Code
[ an implementation of Victor's idea .]
[ it was funded by a kickstarter page .]
You can now try Light Table
via the Light Table Playground!

9.8: web: Bret Victor
. Bret Victor's inspiring resume
and his many cool writings .
. Bret Victor`Inventing on Principle [vid]
from CUSEC 2012 (Canadian University
Software Engineering Conference)
-- a three-day event that brings together
undergraduate and post-graduate students
for learning, networking,
and sharing their passion for software.
9.8: web: chris-granger.com`
Light Table --a new IDE concept
Despite the dramatic shift toward
simplification in software interfaces,
the world of development tools
continues to shrink our workspace
with feature after feature
in every release.
Even with all of these things at our disposal,
we're stuck in a world of files
and forced organization
- why are we still looking all over the place
for the things we need when we're coding?
Why is everything just static text?

Bret Victor hinted at the idea that
we can do much better than we are now
- we can provide instant feedback,
we can show you how your changes affect a system.
And I discovered he was right.
...
 all of this culminates in the ability to see
 how values flow through our entire codebase.
 Here I find a bug where I wasn't passing x correctly.
 I type (greetings ["chris"])
 and immediately see all the values filled in
 not just for the current function
 but all the functions that it uses as well.

Light Table is based on a very simple idea:
we need a real work surface to code on,
not just an editor and a project explorer.
We need to be able to
move things around, keep clutter down,
and bring information to the foreground
in the places we need it most.

Light table is based on
a few guiding principles:

You should never have to look for documentation
Files are not the best representation of code,
just a convenient serialization.
Editors can be anywhere
and show you anything - not just text.
Trying is encouraged
- changes produce instantaneous results
We can shine some light on related bits of code

Docs everywhere
When you're looking at new code
it's extremely valuable to be able to
quickly see documentation left behind by the author.
Normally to do so you'd have to
navigate to the definition of the function,
but lightable ghosts this information in to the side.
Want to know what partial does?
Just put your cursor on top of it.
This makes sure you never have to worry about
forgetting things like argument order ever again.

. we should be able to search all our documentation
in place to quickly see what it is.
Don't remember what was in the noir.core namespace?
It's one ctrl-f away.

This is especially handy for finding
functions you may not even know exist
and seeing their docs right there.
No need to look at some other generated documentation.

Instant feedback
.  to try things out, we can do better
than lispers' REPL - we can do it
in place and instantaneously.
For example we can type in (3 + 4)
and immediately we are shown the result
- no ctrl-enter or anything else.

Light Table takes this idea as far as it can
and doesn't just show you variables to the side,
but actually shows you how the code is filled in.
This lets you see how values flow through
arbitrarily complex groups of functions.

This level of real-time evaluation and visualization
basically creates a real-time debugger,
allowing you to quickly try various inputs
and watch it flow through your code.
There's no faster way to catch bugs
than to watch your program work.

We built drafting tables for a reason
. desktop windows aren't a good abstraction
for what we do as software engineers .
Other engineers have large tables
where they can scatter around
drawings, tools, and other information .
A drafting table is a better abstraction:
We shouldn't need to limit ourselves
to a world where the smallest moveable unit
is a file - our code has much more
complex interactions that we can better see
when we can organize things conceptually.
. We saw an example of this with Code Bubbles,
but why can't we embed a running game ?
Then we can interrogate it,
and have our environment answer them for us.
[9.8:
. an image in the article at this point
shows a desktop where a folder full of files
is represented by a box
whose title is named after the folder
with file names inside the box .
. the right side has boxes of code;
so, for each function you inspect,
it also shows you called function`bodies .)
--
. this reminds of composite editing,
where the editor holds the entire desktop;
so, it serves as desktop layouts that can be
suspended and resumed as if a vmware .
. desktops and their windows
can be edited the same as
when an editor embeds images in text .
. the first compound docs I saw
were ms`office embedded objects:
you could mix & match Word's text columns,
Excel's spreadsheet windows, and various images .
. browsers have this feature (the embed tag);
but browsers are short on editing abilities,
and editors need to be integrated with the OS;
such that I can open a file,
and it unleashes a desktop of windows
all arranged in the way they were before .
. also, the layout editor needs to
control the border style of its windows;
eg, embedded graphics in text
should often have no border at all .
. a 1st class composite document
has everything we like about vmware,
but instead of windowing OS's
our compositing app is windowing apps .]
Code with a little illumination
There's no reason our tools can't
help us understand how things are organized .
In light mode, Light Table lets you
see what functions are called by
the one you're currently working on,
not just by highlighting ones in your code,
but by also showing you their code to the side.
We shouldn't have to constantly
navigate back and forth to see this .

Finally, all of this culminates
in the ability to see not just how
things I type into a scratch editor evaluate,
but how values flow through our entire codebase.
Here I find a bug where I wasn't passing x correctly.
I type (greetings ["chris"]) and immediately see
all the values filled in
not just for the current function
but all the functions that it uses as well.

What languages will it support?
. The first two are Javascript and Clojure,
.... we hit $300k! Python will be the
third language supported out of the gate.
. additionally,
new languages can happen through plugins.

Will it be open source?
. a firm believer in open source software
and open source technologies.
we can guarantee you that Light Table will be
built on top of the technologies that are
freely available to us today.
As such, we believe it only fair that
the core of Light Table
be open sourced once it is launched.
At some level, this is an experiment in
how open source and business can mix
- it will be educational for us all.

What's a license then?
. In order to download packaged distributions,
you'll need a license. Preliminarily,
we're thinking, for individuals,
licenses will be based on a model of:
"pay as much as you can of
what you believe it is worth".
. This gives everyone access to the tools
to help shape our future,
but also helps us stick around to
continue making the platform awesome.
We think what we build will be worth at least $50,
and so that's what we've used for our rewards.

Is it a standalone app?
. there's an instance of webkit as the UI layer
-- completely an implementation detail.
It will run locally on virtually any platform
and out of the gate will support
the big three (linux/mac/windows).

Can I script/extend it?
. It will be scriptable in Javascript
(and many other languages can be
translated into Javascript).
Ultimately the goal of the platform
is to be a highly extensible work surface
- even the initial core languages
will be written as plugins.
This allows us to build development interfaces
we haven't even imagined yet.

What about key bindings?
. by using the awesome CodeMirror editor,
this is something that is easily adapted.
If you're looking for a way to contribute,
help improve CodeMirror
and its emacs/vim plugins!
--[
CodeMirror is a JavaScript component
that provides a code editor in the browser.
When a mode is available for your language
[c, python, go, js, ...]
it will color your code,
and optionally help with indentation.
. rich programming API and a CSS theming
for customizing CodeMirror
and extending it with new functionality.
. it's used by Mergely which is a
powerful online diff and merge editor
(Browser-based differencing tool)
that highlights changes in text.
It can be embedded within your own Web application
to compare files, text, C, C++, Java,
HTML, XML, CSS, and javascript.]

How can I help in the meantime?
. The better CodeMirror is,
the better all internet editors can be!
Past that, help us spread the word.
The more money we get
the more people I can involve in the project,
the more languages we can support,
and the more powerful the entire platform.
There's tremendous potential
-- we haven't even scratched the surface yet!

About the Developer:
. helped design the future of Visual Studio,
and released numerous open source
libraries and frameworks.
. for Microsoft was the Program Manager for
the C# and VB IDE
-- countless hours behind a one way mirror
learning how people develop things.
Since then steeped in the world of
startups and OSS.
. worked with the guys at ReadyForZero
to build readyforzero.com,
created the Noir web framework,
built the SQL abstraction layer Korma,
and released a host of ClojureScript libraries
to make client side development a breeze
- many of which are now featured in
the canonical books for Clojure.
Even more recently,
built Bret Victor's live game editor
after watching his inspiring
"Inventing on Principle" presentation .
Light Table at news.ycombinator.com:
One thing Light Table could pick up / learn
is the ability to scale as function set grows,
to gain a kind of fractal navigability.
--[. I think he's refering to the call tree idea
aside from the view's detail modes
(nodes-view vs thumbnails vs fullview)]
stcredzero/"I told you so!"
Smalltalkers have been doing [LightTable]
--[the right thing]-- since the 80's
(If only we could have communicated
about this as well as Mr. Granger).
The first and the last points [under Also:]
were satisfied by lightning-fast searches of
"senders" and "implementers" .
1980's smalltalk:
- Smallest unit of code is the function.
- Able to get instant feedback on code changes.
- Multiple editors with just one function in it.
Show code in an "area of concern" not just in a file.
- The coding environment can show also
results, app windows, graphics, other tools.
- Can save the configuration of the above.
Also:
- You should never have to look for documentation
- Files are not the best representation of code,
 just a convenient serialization.
- Editors can be anywhere
and show you anything - not just text.
- changes produce instaneous results
- We can shine some light on related bits of code .
shykes:
. Dan Ingalls, the father of Smalltalk,
has picked up the baton again,
this time using Javascript.
Check out the MIT-licensed Lively Kernel
-- a new approach to Web programming
. the live demo at JSConf was jaw-dropping;
completely in line with the Smalltalk legacy .
It provides a complete platform for Web applications,
including dynamic graphics, network access,
and development tools.
Field (programming environment)
. embraces most (if not all)
of Light Table's principles.
--
As always, the multi-media programming environments
are miles ahead and nobody knows about them.
Field[by The OpenEnded Group] is amazing.
{Max/MSP, Pd, ...} are a different paradigm altogether,
but have had live editing, documentation a click away, etc
and have been in heavy use for 20+ years.

list of multi-media programming environments?
. the big names are Max/MSP, Pure Data,
vvvv, QuartzComposer, SuperCollider,
ChucK, Processing, openFrameworks,
Cinder, and Field[The OpenEnded Group].
But there are many more smaller projects
such as Lubyk, Overtone, LuaAV,
Faust, Plask, Impromptu and Fluxus.
I also want to plug NoFlo, which is a
'flow-based programming' library for node.js,
which integrates with a visual editor.
the design of design book

gfodor, vdm, nickik:
recommend some reading materials?
Victor's writings
The Design of Design (see part 4)
simplicity’s virtues over easiness’
Alan Kay`Programming and Scaling [vid]
Viewpoints Research Institute
Mindstorms: Children, Computers, And Powerful Ideas
PLATO Learning System [vid]
Mindstorms: Children, Computers, And Powerful Ideas book udacity -- cheap edu
coursera -- cheap edu
khanacadamy -- free videos

2012-09-21

vocabulary size conversion

7.11: adde/vocabulary size conversion:
. if you'd rather not learn a large collection of library calls
it should convert imported source code
by expanding each 5-dollar word
into a paragraph of 5-cent words .
. this could have the side-affect of running slower
because the 5-dollar words are
packing a lot of code into a c module .
. so it might be useful to implement it
only at the presentation layer;
ie, if you don't modify the expansion,
then it converts the expansion back to its 5-dollar word .
9.5:
. another way of putting that,
is that addx should be giving you a dual library
where everything is visible as adda code,
but it's mostly impl'd in c code,
unless you change the c's adda twin,
in which case it compiles that adda change into c,
and then, of course, into a binary .
. notice how Python does it differently:
it auto'compiles your scripting to Python bytecode;
but porting to C requires manual effort .
. the reason for this is that most Python code
makes extensive use of the Python virtual machine,
and there is efficient translation from Python to C;
rather, it takes human skill to sort out
where the hotspots are, and how to untangle them
for separation into a C file .
. adda, on the other hand,
encourages explicit typing;
and, if the user has done that,
then conversion to C should be easy and useful .
. adde should be tracking user's
adda file modifications,
and not bothering to C-translate it
until the user seems to be done tweaking it .

2012-08-23

lang's should document pragmatics

7.21: adda/doc's/intended use as related to resources used:
. here is part of Python's Recommendations
for a library's coding style:
"( Code should be written in a way that
does not disadvantage an implementation of Python
For example, CPython's a += b or a = a + b
is an efficient implementation of
in-place string concatenation;
but in Jython,
the ''.join() form should be used instead.
This will ensure that concatenation occurs in
linear time across various implementations.)
[ie, jython is about java is about oop;
and if you have something like
( a = a op x ) to say in {oop, java, jython}
the oop way to do that is a.op(x)
and if you're a big oop fan and said
( a = b op x )
it's assumed you would never do so for
the case where (a) is the same as (b) .]
--
. this reminded me that part of
documenting a language
should be not only what the resource usage is,
but also the intended application;
ie, it should warn you if it's
not the most efficient way to do something
and point you to what is .

atoms equivalent to tuple singletons

7.7: adda/syntax/atoms equivalent to tuple singletons:
. does a function's arg need a parenthetical?
ie, can we say( f x ), instead of( f(x) )?
if (f x) can be the same as f(x),
then all atoms (such as x)
can be seen as singleton tuples (ie, x=(x) );
so, then there's no need for adda to copy
Python's singleton tuple syntax: ( (x,) ).

2012-08-01

Python's generators and coroutines

2.16: adda/cstr/1st-class functions/
generators and coroutines:

. a generator in python
is a function identified by it's body:
it's calling yield instead of return .
. the easier way to view this
in a typed lang, like adda,
is to set the return type as a stream ?
. streams are conceptually like files
so they should work like files;
eg, to restart sequence do an
f.open(name of generator instead of file) .
. streams are like sequences, in that
seek(n) can be done by restarting the generator
and asking for an nth item .
. the coroutine in python is like a generator;
but instead of streaming output,
it has a streaming input:
f`open mycoroutine(init);
f`put (some data to send to it) .
. it could do put's to output, and get's to input;
being both a generator and a coroutine .

2012-07-19

Python with GUI on Mac

6.30: summary:
. after seeing David Mertz's
Text Processing in Python/SECTION 3
/Platform-Specific Operations,
I'm seeing Python has a Carbon API,
which you'll now see is deprecated,
so, I wondered if there's a Cocoa API now .

. other than extending and embedding C,
python is not really supporting cocoa:
. the latest python version does offer
platform-specific modules
but only for Windows and Unix
(unix does includes mac and any
Cocoa binaries that are runnable from the shell,
so our access core services
is by feeding text to a shell?! ).

. the best idea I found was ObjP:
-- much less complex than PyObjC --
it's a code generator that helps with both
embedding python into obj'c,
and extending python with C
from which you can use obj'c .
. if you'd still rather use PyObjC,
there is support for it in xcode 4 .
(see Xcode4CocoaPythonTemplates)

. a future idea I found from this search
was a python equivalent to Apple's MacRuby:
instead of being a bridge to cocoa,
it would have Python implemented in Cocoa
-- just like Jython is impl'd in Java . Mython ?

6.30: AppleScriptable or stay with Python?:
. mac's vision for scriptable app's
revolves around the use of AppleScriptObjC,
which expects you to write your tools in obj'c,
and then compose tools using AppleScript .
. obj'c can compile and run AppleScripts
by using NSAppleScript .
. Python can do the same with osascript
-- call AppleScripts from python --
or
NSAppleScript -- build & run it in Python .
. see Designing for Scriptability
about ensuring your interface language
fits in with AppleScript ...
and before you give up, consider this:
many of your users
might rather reuse your code with
Apple's Automater or Applescript Editor
than with python's tools .

2011-05-30

the state of scripting concurrency

4.19: adda/co/the state of scripting concurrency/intro:
[5.30:
. this excerpt from stackoverflow.com
had me looking at concurrency again:]
"( If you have programmed expertly in
Perl Python and in Java for 10 years,
then you'll probably write your program in Perl
because you'll complete the program faster,
the program will have fewer lines of code,
and the language will stay more out of your way.
If you are not an expert in Perl, Python, or Java,
and you have to choose one of those languages,
then I recommend that you choose Python.
... except if threading is important (re: GIL)...)
green threads and the need for GIL:
[5.30:
. processes are full programs running concurrently:
each process has its own space for
both variables and code;
threads are like processes except that
they share the locals and code
of the process that spawned them .
. threads and processes can be either
native -- implemented by the os,
or green -- impl'd by an app (eg, a scripting interpreter).
Erlang provides a green process(vs thread),
which is much more lightweight than a native process
because it does share (read-only) code space .

. a computer with multiple cores
can be truly concurrent:
doing more than one thing at the same time
by contrast, timeslicing is virtual concurrency:
giving each task a slice of computer time .
. the GIL (Global Interpreter Lock)
is a mutual exclusion lock
that prevents true concurrency:
insuring that app threads are timesliced,
rathering than being mapped to multiple cores .
. it's needed when the the interpreter,
it's libraries, or its plugins
are not thread-safe because of
threads being able to share variables
that aren't protected with atomic access:
ie, being able to complete a read or write
before having being interrupted by the timeslicer .

Ruby's support for concurrency:
. IronRuby builds on top of .NET Threads,
so they map 1-1 to OS-threads as well;
JRuby does likewise on the JVM .
[5.30:
. these GIL-free variants of Ruby
provide threads without any warranty:
it's up to you to insure that
all your dependencies are thread safe .
. concurrency models supported by Ruby
include Threads, Processes and
Fibers (systems-level coroutines).
. other abstractions to consider include
Coroutines, Actor Models, Petri Nets, Process Algebras
(particularly CSP and the Pi-Calculus),
Software Transactional Memory
and distributed Map/Reduce algorithms
-- see Go, Occam-Pi, Clojure and Erlang;
Ruby could impl' these with current libraries;
eg, EventMachine or RevActor .
. Ruby needs a standard actor/executor API
-- not platform-specific impl's of actors .

. the future of high performance concurrency
is libdispatch/GCD;
for the java/scala folks, there's HawtDispatch:
(JRuby's port of that is at github/jcd).
. HawtDispatch is a thread pooling and
NIO event notification framework API
modeled after the Apple`libdispatch API
that powers Apple's Grand Central Dispatch (GCD).
It allows you to easily develop
multi-threaded applications
without the usual problems .
]-5.30
python's gil:
Juergen Brendel argues against the GIL;
Guido maintained the GIL is here to stay
until someone can prove its removal
doesn't slow down single-threaded Python code.
. the language doesn't require the GIL
but, the CPython virtual machine
that has historically been unable to shed it.
it was shown that even on the platform
with the fastest locking primitive (Windows at the time)
it slowed down single-threaded execution
nearly two-fold .
. removing the GIL complicates life for
extension module writers
by precluding the use of global mutable data .
There might also be changes in the Python/C API
necessitated by the need to lock certain objects
for the duration of a sequence of calls.
Bob Warfield 2007`analysis of gil:
Guido is Right to Leave the GIL in Python,
Not for Multicore but for Utility Computing
considering large scalability issues
in the world of SaaS, Web 2.0,
and utility computing fabrics;
eg, Amazon EC2(elastic computing).
. a concurrency capability based on threads
has done nothing to access multiple machines
-- for that you need socket-connected processes .
. furthermore,
a simple, safe and reliable concurrency language
should be focused on a [green]process model,
not a thread model.
[5.29:
. concurrent programming has a bad reputation
for being both buggy and undebuggable,
but it's based on work with threads .
5.30:
. to be efficient and safe,
a language needs to pervasively support
green processes:
a unit of concurrency that does share
read-only mem like a thread does
but does not share variable mem .
. pervasive support means that
not only is the standard library thread safe,
but all reusable modules are also .]

another way threads don't scale:
The fundamental problem with threads
is that sharing requires locking
which doesn’t scale (or compose),
and is prone to races and deadlocks .
Erlang features [green]processes
where isolation is enforced by the language
rather than the operating system .

. Erlang is a functional language
with strict copy semantics
and with no pointers or references.
[. it is merely the semantics
that are pass-by-copy;
the impl'details involve
read-only pass-by-reference .]

Why don’t we all switch to Erlang?
Messages have to be copied.
You can’t deep-copy a large data structure
without some performance degradation,
and not all copying can be optimized away
(it requires behind-the-scenes alias analysis).
so, mainstream languages don’t abandon sharing;
instead, they rely on programmer’s discipline
or try to control aliasing.

2011-04-30

SML (standard metalanguage)

4.24: news.adda/lang"sml (standard metalanguage):
. standard ml is influenced by
ISWIM (I see what it means)
which influenced not only ML,
but also many other functional languages
such as SASL, Miranda, and Haskell .
Landin's SECD machine used call-by-value;
if the imperative features are stripped out
(assignment and the J operator)
leaving a purely functional language,
it then becomes possible to switch to
lazy evaluation (vs eager evaluation);
that was the path of SASL,
KRC (Kent Recursive Calculator),
Hope, Miranda, Haskell, and Clean.
. A goal of ISWIM was to look more like
mathematical notation,
so it replaced ALGOL's ways with
the pythonic off-side rule
(newlines take the place of semicolons;
indentation represents parentheticals or begin-end pairs )
. abc and python are hardly the only off-siders:
* Boo * BuddyScript * Cobra * CoffeeScript
* Curry * F# (if #light "off" is not specified)
* Genie * Miranda * Nemerle * Occam
* PROMAL * Spin * XL * YAML .

news.adda/lang"CoffeeScript/a hll-to-hll translator:
. CoffeeScript compiles to JavaScript
adding syntactic sugar inspired by Ruby and Python
to enhance JavaScript's brevity and readability,
as well as adding more sophisticated features like
array comprehension and pattern matching.

2011-02-28

modulus vs remainder

2.7, 2.16: Using the mod() function with negative numbers
"modulo" as a relation:
[pointing in the same direction on a clock]
any two numbers a and b are congruent modulo m
if (a - b) is a multiple of m.
. math's idea of "integer division":
x . . . . : 2.7, -2.7
floor(x) .: 2.0, -3.0
ceiling(x): 3.0, -2.0 .

. for both mod (modulus) and rem (remainder),
they are related to div by:
A = ( A DIV B ) * B + A % B
where % is either { rem, mod };
. {mod, rem} are similar in that
they are both consistent with a div function;
but mod's div truncates towards -∞ (negative infinity);
whereas, rem's div truncates towards zero .
. mod(-n, d) -- vs rem -- is the complement
of mod(n, d); eg,
MOD(-340,60)= 20
MOD(340,60)= 40
(40 and 20 are complementary modulo 60;
ie, 40+20 = 60).
. truncating toward -∞ (negative infinity)
means that if n (the numerator) is negative;
then the usual integer div needs to be decremented:
div = int(n/d)-1
-- so that the truncation is consistent by
always reducing the value instead of
changing it willy-nilly towards nil
(that'd be adding value when truncating negatives
while subtracting value when truncating positives).

Ada's "mod" (modulus) and "rem" (remainder):
. notice that while Ada supports both {mod, rem}
it has only rem-consistent div (truncate toward zero)
ie, observing the identity (-A)/B = -(A/B) = A/(-B)
for A,B in positives .
by contrast, Python truncates toward -infinity .
. here is Python's mod-consistent div ( % means mod )
. 123 / 10 = 12,  123 % 10 = 3
-123 / 10 = -13, -123 % 10 = 7
. 123 /-10 = -13, 123 % -10 = -7
-123 / -10 = 12, -123 % -10 = -3

translation from ada to c:
. ada's {rem, mod} is defined for (n,d) in Z
(integers, numerator and denominator can be negatives);
let c`% = abs(n) % abs(d):
-- (%) is c's symbol for remainder function --
then depending on the original signs of n,d,
use the following table to know whether to
{complement, negate} c`% .
-- complement (~) means abs(modulus) - x;
so for modulus = 5, the complement
of 1..4
is 4..1, respectively .
for rem:
. (n rem d)`sign = n`sign
details:
. when n,d are both positive,
or only d(modulus) is negative:
eg, 1...4 rem -5 = 1..4
or 1...4 rem 5 = 1..4
--> c`% .
. when n,d are both negative,
or only n is negative:
eg, -1...-4 rem -5 = -1 .. -4;
or -1...-4 rem 5 = -1..-4
--> -c`% .
for mod:
. (n mod d)`sign = d`sign;
if only n or only d is negative,
then complement .
details:
. when n,d are both positive:
eg, 1...4 mod 5 = 1..4
--> c`% .
. when n,d are both negative:
eg, -1...-4 mod -5 = -1 .. -4
--> -c`% .
. when only d(modulus) is negative:
eg, 1...4 mod -5 = -4..-1
--> -~c`% .
. when only n is negative:
eg, -1...-4 mod 5 = 4..1
--> ~c`% .

2010-07-31

golang's issue#9 -- clashes with go! -- revisited

10.7.30: news.adda/lang"go!/clash with go

. I was reminded of a name dispute
between Google and a language designer,
and couldn't remember the details;
I didn't know how it compared to
Microsoft denying Linux PC's
the name Lindows (mocking their name ?)
so I revisited the matter .

wiki's take needs an update:
"( On the day of the general release,
Francis McCabe, developer of the
Go! programming language,
requested a name change of Google's language
to prevent confusion with his language.)
. that is not quite accurate:
he claimed, point blank, that "(Go)
was exactly the name of his language,
and if you look on his personal filesharing website,
indeed, "(go) is the nickname;
but,
in both his whitepaper (pdf) and his book intro,
the published name is "(go!) not "(go):

Go!
– A Multi-paradigm Programming Language
for Implementing Multi-threaded Agents
K.L. Clark Dept. of Computing Imperial College London, UK
F.G. McCabe Fujistu Labs of America Sunnyvale CA, USA


. reading that paper,
you soon find why the name is "(go!)
-- and not go --
. the main purpose of go! is to
reverse some of prolog's faults;
. cleverly,
the reverse of "(go!) is (!og)
as in the "(log) of "(prolog)
which stands for (logic).

. the one thing he wishes most
would go away in prolog
is the "(!) operator (pronounced "(cut))
hence the name "(go!)
as in "(go away, Cut operator):
"( Go! has many features in common with Prolog,
particularly multi-threaded Prolog’s,
there are significant differences
related to transparency of code
and security.
Features of Prolog that mitigate against
transparency,
such as the infamous cut (!) primitive,
are absent from Go!.)
. meanwhile, the name of
google's go lang'
could be short for "(GOogle),
and is said to be a reference to
the design being motivated by
a need for compilers to go faster:
"( "In Google we spent so long
literally waiting for compilations,
even though we have parallelism
in all of these tools to help;
even incremental builds can be slow.
And we looked at this and realized
many of the reasons for that
are just fundamental to C and C++,
as were the tools that everybody used .
So we wanted to start from scratch .)
. wikipedia has this reference:

Google 'Go' Name Brings Accusations Of 'Evil'
InformationWeek Thomas Claburn November 11, 2009

"( McCabe's Go! programming language
is described in a 2007 book he published
and in a research paper published in 2004 (pdf)) .
McCabe:
"( It is in the tradition of
languages like Prolog.
In particular, my motivation was
bringing some of the discipline
of software engineering
to logic programming.)
. and *that*
is exactly the origin of the "(!)
-- an essential part of the name's genius --
so it's bewildering why he would
want to also claim the "(go) name
-- in addition to the "(go!) name .
some wikipedia authors speculate
that there could be some confusion,
"(McCabe requested a name change
to prevent confusion with his language, Go! .)
indeed, some have used "(yahoo!) as an example:
"( Comment 77 by wrinkles, Nov 11, 2009
Go and Go! are not the same? Great,
I just started a new company called Yahoo.)
you can't use "(Yahoo) as a noun
for something other than Yahoo!
without giving some context .
eg, hearing "(go!) might provoke
the question:
"( did you mean "(go faster),
or "(go away cut-operator) ?
) .]
. there's a link to to go's "(Issue 9) debate
where Frank McCabe wrote up an issue with Go:
"I have already used the name for
*MY* programming language."


all of McCabe's entries in Issue 9 to date:
"(
by fmccabe, Nov 10, 2009
I have been working on a programming language,
also called Go,
for the last 10 years.
There have been papers published on this
and I have a book.
I would appreciate it if
google changed the name of this language;
as I do not want to have to
change my language!

Comment 2 by fmccabe, Nov 10, 2009
If you google (sic) francis mccabe go
you will find some references.
I published the book on lulu.com

Comment 5 by fmccabe, Nov 10, 2009
My language is called Go!.
The book is called Let's Go!.
The issue is not whether or not Google's go
will be well known. It is one of fairness.
[7.31:
. if google throws a party for "(go)
they should invite "(go!),
to make sure in the future
people finding (go!) don't assume it's
some extension of google's (go) ? ]
Comment 300 by fmccabe, Nov 11, 2009
. I am very grateful for the
support I have received on this thread.
It seems to have hit a nerve.
. I want to make one particular point,
some people have suggested that
"I should be grateful"
for the extra advertising.
My response to that is that
I was not actively looking for this advertising.
[7.31:
. doesn't clarification require advertising
when there is such disagreement on
whether (go) clashes with (go!) ?
]
It was not me who picked a clashing name.
. I fully understand that it is possible that
insufficient search was done before hand.
However, when I picked the name Go!
I did try to find out if anyone else was using it.
In fact, I was kind of surprised that no one was!;
since it was clearly a great name.
. For those interested, Go! is a bi-lingual pun.
[7.30:
-- in Japan, where Prolog is very popular .
]
My previous work focused on a language called April.
In Japanese, the literal back-translation of April
is "4th Month".
Go is Japanese for 5.)

responses to McCabe's issue (verifying go! exists):

Comment 81 by yarkot1, Nov 11, 2009 [paraphrased]
'Go!' is available on sourceforge.net (networkagent),
and was developed jointly with McCabe and Clark
with commits back in 2000:
"A group of systems for building network-oriented intelligent agents,
consisting an agent communications infrastructure,
April - an agent construction programming language,
Go! - a logic programming language
and DialoX - an XML-based user interface engine".
[7.30:
. go! can be pronounced "(networkagent go)? ]

Comment 243 by andy.arvid, Nov 11, 2009
The Go! Source: homepage.mac.com
[redirects to nk11r10-homepage.mac.com]
april-9-30-07.tgz 2.3 MB
go-9-30-07.tgz 3.8 MB
InstallingGo.rtf 6 KB
ooio-9-30-07.tgz 821 KB
[7.30:
. see the problem here?
in some situ's (like unix) it's not wise*
to use the "(!) character in the name .
... could name it gol to look like (go!) ?
*: Characters you should not use in filenames:
| ; , ! @ # $ ( ) < > / \ " ' ` ~ { } [ ] = + & ^
. ]

Comment 454 by abraham.estrada, Nov 11, 2009
http://en.wikipedia.org/wiki/Go!_%28programming_language%29
[7.30:
. that link includes these resources:]
References
Clark, K.L.; McCabe, F.G. (2003).
"Go! for multi-threaded deliberative agents" .
International Conference on Autonomous Agents (AAMAS'03): 964–965.
Clark, K.L.; McCabe, F.G. (2006).
"Ontology oriented programming in go!" .
Applied Intelligence 24 (3): 189–204.
Further reading
Clark, K.L.; McCabe, F.G. (2003).
Ontology Oriented Programming in Go! .
Clark, K.L.; McCabe, F.G. (2004).
"Go!—A Multi-Paradigm Programming Language
for Implementing Multi-Threaded Agents" .
Annals of Mathematics and Artificial Intelligence 41 (2-4): 171–206. .
Comment 222 by keithsthompson, Nov 11, 2009
There's a Go! program on 99-bottles-of-beer.net;
it's been there since 2005.
That site is an excellent place to check for existing language names.

responses to McCabe's issue (resolution attempts):

Comment 6 by zhenshe41, Nov 10, 2009
In Go! , can the IDE know the differences between
Go! and go ?

Comment 40 by patla073, Nov 11, 2009
Why not just name it Golang?
Erlang - "Ericsson Language"
Golang - "Google Language"

Comment 64 by david.kitchen, Nov 11, 2009
@40 Golang looks like a winner...
they're already using the domain golang.org
and it looks like no-one else is using
that as a language name.

Comment 45 by tuxthelinuxdood, Nov 11, 2009 [paraphrased]
It is obvious that "do no evil" Google employees
did not research the name
in terms of existing languages before release.
[7.30:
. how is it obvious?
they could have easily seen C# vs C
as a precident for go vs go! .]

Comment 54 by pierrevm, Nov 11, 2009
First Closure (name-squatting Clojure)
now Go stopping Go! in its tracks.
Just another week in the life of a giant company. [...]

Comment 66 by yless42, Nov 11, 2009
[...]
. as you all rightly pointed out,
one is called "go"
and the other is called "Go!".
Am I the only person seeing the similarities
between that and "C" == "C#"?
If you think that having an extra character
is a problem,
you should go speak to Microsoft first.
[...]
. I suggest you see these lists:
wikipedia.org, esolangs.org .
. See how many languages there are on those lists
where one name is only separated from another name
by one character? [...]

Comment 70 by pygy79, Nov 11, 2009
@66 the spelling may be different,
but in both cases (Clojure and Go!),
the pronounciation of the
Google newly introduced products
is identical.
[7.30:
not identical in both cases:
. just as C# is pronounced c-sharp;
go! should be pronounced go-bang
or go-cut (prolog`cut-operator) .]

Comment 79 by rnmboon, Nov 11, 2009
They should change the name to "god".
Why hold back on the level of ambition here.

Comment 80 by j...@ww.com, Nov 11, 2009
Google should do the right thing
and change their name, be gracious about it.
. Do no evil, remember ?

Comment 89 by jamesda...@gmail.com, Nov 11, 2009
#77: Why not start a company called "Google!" ?

Comment 90 by AxelSanner, Nov 11, 2009
[wikipedia's don't be evil]
then ... don't
[7.30:
. that page tells about "(don't be evil) being
Google's "(informal corporate motto (or slogan));
the page states that in January 2010,
"(Apple CEO Steve Jobs strongly criticized the slogan,
saying: "We did not enter the search business.
They[Google] entered the phone business.
Make no mistake they want to kill the iPhone.)
-- and then he scoffs at "(don't be evil);
but, he might be just showing off
to shareholders . look:
. Google is in the phone business because
the phone is where much of the googling
could be coming from;
so, they just want to make sure
a mobile platform is out there .
. Apple still has a competitive product:
a phone running on the secure
mac microkernel with solid software
(I don't have a smartphone,
but my mac desktop is a lot more solid
than my linux laptop
-- the linux world scoffs at microkernels
for losing energy, but Ubuntu is more likely
to lose my data ... I need to
take the Android hint
and do more cloud computing!) .]

Comment 157 by mich...@sun-sol.com, Nov 11, 2009
They should name the language "Evil--"
(do no evil...).

Comment 161 by ropers, Nov 11, 2009
[...] appreciating the difference between
terms that merely sound
and terms that actually *are* identical. [...]

Comment 170 by tomhaste, Nov 11, 2009
Some of these comments are plain silly. Heres another to join in;
If Go isnt the same as Go!;
Then Google isnt the same as Google!.

Comment 212 by Mo6eeeB, Nov 11, 2009
[...]
"Go!" wouldn't work, because
the only way I can think
of audibly pronouncing the "!"
is "bang" and "Go bang"
just sounds silly.
[...]

Comment 219 by lozeno1982, Nov 11, 2009
To those who say "it's like C and C#"
or "it's like C and C++" etc...
No, it's not the same case.
. First, C# and C++ are called this way
because they inherited their {sintax, syntax}
from C
and wanted to express that kind of legacy;
Second, they are actually pronounced DIFFERENTLY:
it's "See" (C), "See-plus-plus" (C++)
and "See-Sharp" (C#).
. Now, how do you pronounce Go and Go! ?
I read them both the same way: "Go".
I can't read a "!" to make a difference.
[7.30:
. this reminds that the reason yahoo
spells their name with a "(!)
is to pronounce the word with enthusiasm;
literally to step up the octave
of the last syllable .]

Comment 255 by insomniac8400, Nov 11, 2009
Go and Go Bang
are as different as C and C Sharp.

Comment 274 by THM...@gmail.com, Nov 11, 2009
[...]
(C vs. C++, vs. C# anyone)).

Comment 312 by merkey88, Nov 11, 2009
This reminds me of an old court case
where Yahoo! had to change their name to the previously stated
from Yahoo (with no exclamation).
By contrast, your programming language
already has the exclamation point,
so as long as Google does not use
an exclamation after Go (or go),
there should be no reason to change.

Comment 382 by samterrell, Nov 11, 2009
[...]
If Wikipedia can deal with the issue,
[... GML, Go, Go!, GOAL, ...]

Comment 521 by darkhorn, Nov 12, 2009
[...] write a new language called "Google!".'
Comment 525 by ashish.afriend, Nov 12, 2009
@521: There are differences
in a language and a company.

Comment 563 by kikito, Nov 12, 2009
You can read the ! symbol in English.
It is commonly pronounced as "Bang".
"Go Bang" vs "Go"
is exactly the same difference as in
"C Sharp" vs "C", pronuntiation-wise.

Comment 584 by malonsosanchez, Nov 12, 2009
[...]
Go and Go! are very similar.

Comment 610 by davidsinger0, Nov 12, 2009
[...]
. you yourself said you used the term
"Let's Go!" for a book
which if you google is the name of a
very popular book series.
Are you then infringing on their rights?

Comment 654 by roman.go...@gmail.com, Nov 12, 2009
. Nothing wrong with google using Go,
just like nothing wrong with
C++ using the C,
nor using it in C# by Microsoft.
There is no confusion,
and there is no real difficulty in finding
help for those languages.
. I think this is a non-issue
and is just an excuse for people to
get into the town-hall mentality
of yelling out absurdities
and not looking at the facts.
[...]
. Go and Go! can co-exist,
even if !Go comes out.

Comment 741 by victor.petrov, Nov 12, 2009
[...]
For those of you who
brought the C -> C++ example:
your example isn't valid
in this situation.
C++ was actually a set of
extensions to the C language.
Google's Go is NOT
an extension to Go!,
nor is Go! an extension to Go.
[7.30:
. but the point is that
they are distinguishable names;
also, C# is not an extension
of either {C, C++},
and people thought that was a great name,
easily pronouncing it c-sharp;
just as we'll easily pronounce
go! as go-Cut .]

Comment 744 by coolboygreatone, Nov 12, 2009
@741: What about C++ and C#
P.S. : Google should not change the name

Comment 828 by julian.notfound, Nov 13, 2009
Forgot to put a link to slashdot discussion .

Comment 843 by davidsarah.hopwood, Nov 13, 2009
[7.30:
. one David-Sarah Hopwood
has been active in the E lang'
and cap'based security
where she's had many pro' conversations
with several google employees:
Ben Laurie [@] benl@google.com (2009)
Mike Stay [@] stay@google.com (2009)
Mark S. Miller [@] erights@google.com (2008...2010)
. ]
. "Go" is a really terrible name
for a programming language.
Besides the two languages,
it has two common meanings in English
(the verb and the name of the board game),
and
it also means "naked" in Croatian,
[7.30:
-- naked, as in barefoot-fast?
]
and "him" in Polish.
[7.30:
-- him, as in speed & strength vs longevity?
]
This many existing meanings
is what you would expect
for such a short word.
. Anyway, who chooses a name for
a programming language these days
without googling "FOO programming language"
to see if it's already taken?
That's impolite at best;
even downright negligent.
[7.30:
but why assume they didn't see "(go!) ?
would go# be ok in a C# world ?
.]
. The paper on the original Go! language,
incidentally, is at
http://www.doc.ic.ac.uk/~klc/annals.pdf
. It's a concurrent-logic dialect of Prolog
with asynchronous message passing
and Hindley-Milner type inference. [link]

Comment 878 by Lucretia...@yahoo.co.uk, Nov 14, 2009
[...] stop trying [to] make C safe
and use Ada instead,
[...] Just a thought, eh Google!?
[7.31:
. what?! Go is hardly a safer C;
it's basically a quicker Python .]
[7.30:
. like most dev'houses, google has to
reach for what the market will offer;
most hot-shot coders will not
touch that verbose language;
c is low-level, but has a huge library,
and your glue code is compact,
not verbose;
your tools are solid and familiar .]

Comment 891 by wrolufsen, Nov 15, 2009
My vote is for Go@, pronounced like 'goat'.

Comment 932 by graham.p...@gmail.com, Nov 16, 2009
Google probably already knew about
"Go!" (or "gobang" as it may be pronounced,
[...] So "Go" without the "!"
is like "C#" without the "#".
Also, I doubt you can trademark "Go"
so legally there's not leg to .

many suggested calling it plan9:
"( The name Plan 9 from Bell Labs
is a reference to the 1959
cult science fiction B-movie
Plan 9 from Outer Space.)
)

. issue 9 is still open .

. McCabe's old blog's about-page is taking comments .

review of other clashes with "(go):

. another name clashing with "(go)
is a different sort of "(language):
"(the cultural roadmap for the city girl)
... then for a lack of language there is
"(go) family news portal by Disney .

. finally, for some foreign language,
"(Go!) is the english version of weg!:
. an Afrikaans language outdoor and travel magazine;
focuses on affordable destinations in South Africa
and the rest of Africa.

2010-03-31

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 .

2009-07-06

orca -- the python replacement

6.21:
. python was developed on Amoeba but that platform now features orca?
http://www.cs.vu.nl/~ast/publications/tse-1992.pdf

. orca has modula-2`syntax;
and is for parallel programming on distributed systems,
based on the shared data-object model,
a simple and portable form of object-based
distributed shared memory. [threads are sharing ada`protected-types]
Processes communicate through shared data,
even if the processors on which they run
do not have physical shared memory,
using a novel broadcast protocol .

. Message passing is less suitable if several processes need to
communicate indirectly, by sharing globals .
[ they are talking about the same thing ada was
when it added protected types as an ipc mechanism
after it was noticed that the rendezvous
couldn't do the entire ipc job by itself efficiently ] .

. studying the implementation of
parallel applications on distributed systems,
we started out by implementing several
coarse-grained parallel applications on top of the Amoeba system,
using an existing sequential language extended with
message passing for interprocess communication

We felt that, for parallel applications,
both the use of message passing and a sequential base language
are complicated for applications programmers to use.
Since then,
we have developed a new language for distributed programming .
[and, like python] Orca is intended for
applications programming rather than systems programming .
. the Orca constructs are designed to have
semantics close to conventional languages,
thus making it easy for programmers to learn Orca.
An important goal in the design of Orca was to keep the language simple .

Most distributed languages simply
add primitives for parallelism and communication
to a sequential base language, but ignore problems due to
poor integration with sequential constructs .
. A typical example is passing a pointer in a message,
which is usually not detected and may cause great havoc .