Domain: pipeline.com
Stories and comments across the archive that link to pipeline.com.
Comments · 25
-
Weak programmers
Python creator Guido van Rossum has said most programmers aren't used to functional languages.
-
Re:Gawd
-
Re:Gawd
-
Looks like Henry G. Baker's COMFY 6502 compiler
Fun! This 6502-assembler-in-LISP looks similar to Henry G. Baker's "COMFY" 6502 compiler (described in "The COMFY 6502 compiler", SIGPLAN Notices, 1997). You can check out the COMFY-6502 implementation that uses Common Lisp (sadly this appears to be entrapped in the ACM non-commercial-use-only license, though for 6502 code that isn't very limiting). One cool thing about the approach of using LISP as an "assembler" in general is that unlike many traditional macro assemblers, this approach can easily do stuff like choose the optimal instruction set for branches because it can determine if it's in range for a short branch and use them when available. You can do it other ways, of course, but it's pretty elegant in LISP. Those interested in this sort of thing might like my page on 6502 Language Implementation Approaches or my page on making LISP-based languages more readable (especially sweet-expressions).
-
PsyOps, OSS, CIA, and a rubberhose in a crypotree!
I BREAK FOR WATER BOARDING!
:: PsyOps ::
+ http://www.pipeline.com/~psywarrior :: The Office of Strategic Services :::
+ http://guardianspies.com/
+ http://osssociety.org/
+ http://ossreborn.com/
+ http://ossog.org/
+ http://ossinitaly.org/
+ http://www.icdc.com/~paulwolf/oss/oss.htm :: CIA ::
+ http://www.zoklet.net/totse/en/politics/central_intelligence_agency/index.html
+ http://cryptome.org/0005/cia-iqt-spies.htm
+ http://www.youtube.com/user/ciagov
+ http://www.flickr.com/photos/ciagov
+ http://www.time.com/time/magazine/article/0,9171,1004145-1,00.html
+ http://en.wikipedia.org/wiki/KUBARK
+ https://www.cia.gov/ ::: WoW! :::
+ http://publicintelligence.net/
+ http://cryptocomb.org/
+ http://www.cryptome.org/
+ http://www.cryptogon.com/
+ http://afio.com/
+ http://www.afcea.org/signal/signalscape/
+ http://rijmenants.blogspot.com/ -
Re:Oh dear.
What does your favorite language do in this case? Does its memory model have a local stack concept at all? I guess I'm not sure how any other language with a local stack model would implement this without promoting the variable to long-lived storage.
That depends heavily on the language and possibly on how you choose to implement it.
Lua 5, for example, "lifts" the variable from the stack to the heap when a closure referencing it survives the block where it was created (it calls the variables that are closed over "upvalues"). It's not problematic as C++ because you can't get the address of a variable (so it doesn't matter when the address changes). Scheme and Lisp have many different implementations that vary wildly: from the "lifting" that Lua does to letting the variable live on the stack frame where it was created, and garbage collect stack frames the same way heap is garbage collected (see here). I'm not familiar with other language and/or implementation strategies, but I'm sure there are many more ways to do it, and many variations over what I just mentioned.
Is this really a case of C++ not providing the equivalent to some other language or is it instead a case of extra C++ functionality that doesn't map onto another language's memory model well. In C++11 one can certainly create closures over objects that are global, on the heap, etc. and pass them around at will.
Well, even ignoring the fact that you can't really close over variables that are on the stack (because you can "close over" stuff on the heap by making the lambda reference the pointer by value -- I assume that this is what you mean by "create closures over objects that are on the heap"), as far as I can tell closures lose a lot of usefulness when you don't have garbage collection. Just as a quick example (I'm sure this isn't the best example, but it's all I can think of right now), closures are great for setting up ad-hock event handling, with some objects shared by a few event handlers belonging to a window. That would be very awkward in C++, because you'd have to make sure someone is responsible for deleting the objects when the event handlers disappear (one would probably end up having to subclass the window and add the objects to its list of members, and then you'd have to make sure the right original window's methods are virtual, etc.).
-
Re:The most secure phone ever!
-
hakmemThe article barely mentions HAKMEM, but the invsqrt hack is reminiscent of the HAKMEM programming hacks, which were published in 1972. Several of these hacks use bit fiddling with magic constants to perform tasks in straight-line code, that you would ordinarily think of doing with iteration.
HAKMEM is classic bathroom reading for hackers. If you want to do it up old-school, print a copy from original scans, double-sided.
-
Re:process
Basically, every bug fix goes into unstable. If the package get installed into the users system and lasts about 10 days without breaking it, it gets upgraded out of unstable into testing. Testing is where things wait until the whole shebang get 'released' as stable. This happends about every 18 months. But if a package gets into testing and then does bad things, it get removed and then a new unstable version gets moved in. The hard part is having all the 16,000 packages being useable with no release critial bugs for 11 architectures at the same time. This is more or less when they release. This amount of testing catches obvious syntax bugs, endian bugs, corner cases, desktop and server testing bugs, various types of installation testing (ie. embedded, desktop, server, low memory). There are also 'release goals' like transitioning to X.org, to a particular version of: perl, python, gcc,
... or whatevery the project decides to do. Check out: http://debian.home.pipeline.com/ for my big diagram of the process(in en, pt, es). (note: this was posted in the web os called eyeOS) -
Re:FDA?
I don't want to make or eat dog food (java or whatever the managers wanted for me). I want to make and eat crunchy and tasty nice cookies (Python or Ruby could be it).
I decided that, and understood what the term "dog food" really meant when reading this:
I Have a Feeling We're Not In Emerald City Anymore by Henry G. Baker. -
Re:Biased headline
Nice try stooge for the owners, you are off by about 30 years, with accuracy like that your labor should be worth about 4 dollars an hour on the global market. It's all good until YOUR ox gets gored, right?
"The struggle for the shorter work week is the thread that ties together the history of American labor. The country's first union 1;the National Labor Union in 1866 issued its primary demand, "8 hours shall bethe normal work day." The NLU died. But the demand prompted action. In 1872 in New York City thousands of building trades workers stuck for the 40 hour week. Some won. But their g~~h-s were lost in a tide of depression. In 1877 Pittsburgh workers, led by striking rail workers, seized the city and adopted a shorter day. They were shot back to work by federal troops.
1886. Chicago. The Federation of Organized Trades and Labor Unions (later the AFL) called for a national strike for the 8 hour day on May 1. Nearly one million American workers stopped work that day. The nations industrial centers were hushed. Transportation halted. Some employers yielded concessions. Others sighted their targets.
*******
In the 1890's, as wealthy families like the Morgans and Rockefellers tightened their monopolies in industry , Spies' words stood true. The first general strike in the deep south, led by an integrated workforce in New Orleans, won a shorter work day. In this period the U.S. waged two wars. We fought Spain. And the government waged a war on the Western Federation of Miners led by Big Bill Haywood. Casualties in the hundreds. couldn't stop the miners, historically among the most militant of all workers. They won the 8 hour day near the turn of the century."
http://www.pipeline.com/~rgibson/ShorterWorkWeek.h tml -
Re:good book... but only for most serious debian u
check out this site http://debian.home.pipeline.com/ for an updated Debian packaging diagram (soon to be in pt_BR). -Kev
-
GC
Pros and cons of garbage collection?
If you don't CONS, you never need to collect garbage. *rimshot*
More seriously, GC isn't so much about pros and cons, as it is about tradeoffs between the various GC algorithms: time vs. space, low-latency vs. high-throughput, parallelism, etc.
If you're designing a new language, it should include garbage collection, or nobody will use it (i.e., your target audience can already program in C). You may wish to have multiple GC implementations available for different purposes, perhaps to be selected at compile-time.
For a good overview of what's available, see http://www.memorymanagement.org/
My personal favorite is the good old Cheney semi-space collector (and Ephemeral/Generational Garbage Collectors, which are more advanced versions designed to generally have low latency), as it is very straightforward (both to understand and to implement), compacting (it defragments memory, and can perhaps improve cache locality by grouping related objects), and it has high throughput (work is proportional to the amount of live data, not total data).
If memory usage is of more concern than fragmentation and throughput, a mark-sweep collector may be more your style.
There are also "real-time" (and "soft-real-time", i.e. bounded latency [see Henry Baker's Treadmill]) collectors, parallel collectors [including an interesting case for reference counting, usually considered a dog performance-wise, as a viable parallel/remote GC method], "conservative" collectors for C/C++ (see Hans-J Boehm's libgc), collectors for real and hypothetical computers with special hardware and/or OS support for GC features, and some collectors that are just plain weird.
Note also that garbage collection algorithms are considered hard to measure for performance, especially with regard to wall-time latency, so just because a paper(*) claims that a certain GC has certain performance characteristics, be sure to benchmark if it really matters.
(*) Did I mention papers? If you're serious about implementing GC, getting comfortable reading CS research papers is a must. The book "Garbage Collection" is your best friend here, as it provides a very good overview/survey of said papers and algorithms, and it discusses a lot of pros and cons between various algorithms, and useful variants or adaptations that have been applied to previously-published work.
Also check out Henry Baker's papers, because he is a memory management demigod: http://home.pipeline.com/~hbaker1/home.html. -
Re:I don't understand
I've never been able to get the speed of OpenMCL-compiled code to compare the SBCL-compiled code. Every now and then I find myself switching back to SBCL for that reason, as I do some hacking in my free-time that is numerically intensive.
There are always going to be tradeoffs in runtime implementations, unfortunately.
I think the overall best way around this is to work at bundling small (in terms of on-stable-storage) standalone programs built with different implementations, and toss data back and forth among them so as to use the best runtime for any given portion of work.
There's nothing hugely new in making FFI calls out to library modules built in some other language, but most of those are exclusively a high-level language calling some low-level processing functions, with bindings in the high-level language acting as a bridge. SWIG is another example of this paradigm, like your example of CFFI+Fetter.
As an aside, I have recently been living in Chicken Scheme whose origins are in compilation to C following Henry Baker's paper (check out the hand-translated cboyer). The strength of this approach is that arbitrary mixing of Scheme and C is extremely easy.
An example from the mailing list looks like:
The chicken compiler turns the whole example into a set of C functions, one of which evaluates each of the two top-level calls. That function (or the functions it in turncalls) can be invoked by anything that can call it, including a C "main()". ;; simple use of foreign-lambda*
(define yo
(foreign-lambda* void ((int x))
"printf(\"yo: %d\\n\", x);"))
(yo 33)
;; simple use with callback
(define-external (back) void
(print "I'm back!"))
(define call
(foreign-safe-lambda* void ()
"back();"))
(call)
FFI evolution in high level languages is very cool.
Chicken has a structural difficulty with POSIX like threading models, however, because of the use of the C runtime stack as a nursery for young objects, so for now it's one of many Lisp-like languages that don't support native/kernel threading.
Like many modern Schemes it has a growing library of useful things one would do in, for example, Common Lisp. Sometimes, however, I find myself handing a bunch of data from one Lisp-like runtime to another Lisp-like runtime for processing in it, because the latter is faster or has a library or feature set that makes a particular sub-task easier to write.
Writing to shared memory, writing a bunch of data to a file, or a socket, or anything along those lines, to be read and processed and answered by a process made in a Common Lisp environment, is something I've actually done from time to time.
This is something that can be done and shipped now, rather than waiting on changes to a given Lisp-like implementation.
Some downsides are that the runtimes can be large and resource-hungry, you will never share resources as well as with threads inside a single process, and people wanting to build from your source code will have to deal with the multiple environments' idiosyncracies in building standalone binaries.
Some upsides are that interprocess synchronization does not have to be particularly computationally or bandwidth intensive (there are terse/fast serialization tools available), and you can distribute the runtimes across multiple processors, multiple systems, or both.
Personally, I think that with computational power increasing, this kind of "heavyweight threading" (pardon the abuse of the terminology) seems a lot less painful for the advantages it can bring. -
Re:I don't understand
I've never been able to get the speed of OpenMCL-compiled code to compare the SBCL-compiled code. Every now and then I find myself switching back to SBCL for that reason, as I do some hacking in my free-time that is numerically intensive.
There are always going to be tradeoffs in runtime implementations, unfortunately.
I think the overall best way around this is to work at bundling small (in terms of on-stable-storage) standalone programs built with different implementations, and toss data back and forth among them so as to use the best runtime for any given portion of work.
There's nothing hugely new in making FFI calls out to library modules built in some other language, but most of those are exclusively a high-level language calling some low-level processing functions, with bindings in the high-level language acting as a bridge. SWIG is another example of this paradigm, like your example of CFFI+Fetter.
As an aside, I have recently been living in Chicken Scheme whose origins are in compilation to C following Henry Baker's paper (check out the hand-translated cboyer). The strength of this approach is that arbitrary mixing of Scheme and C is extremely easy.
An example from the mailing list looks like:
The chicken compiler turns the whole example into a set of C functions, one of which evaluates each of the two top-level calls. That function (or the functions it in turncalls) can be invoked by anything that can call it, including a C "main()". ;; simple use of foreign-lambda*
(define yo
(foreign-lambda* void ((int x))
"printf(\"yo: %d\\n\", x);"))
(yo 33)
;; simple use with callback
(define-external (back) void
(print "I'm back!"))
(define call
(foreign-safe-lambda* void ()
"back();"))
(call)
FFI evolution in high level languages is very cool.
Chicken has a structural difficulty with POSIX like threading models, however, because of the use of the C runtime stack as a nursery for young objects, so for now it's one of many Lisp-like languages that don't support native/kernel threading.
Like many modern Schemes it has a growing library of useful things one would do in, for example, Common Lisp. Sometimes, however, I find myself handing a bunch of data from one Lisp-like runtime to another Lisp-like runtime for processing in it, because the latter is faster or has a library or feature set that makes a particular sub-task easier to write.
Writing to shared memory, writing a bunch of data to a file, or a socket, or anything along those lines, to be read and processed and answered by a process made in a Common Lisp environment, is something I've actually done from time to time.
This is something that can be done and shipped now, rather than waiting on changes to a given Lisp-like implementation.
Some downsides are that the runtimes can be large and resource-hungry, you will never share resources as well as with threads inside a single process, and people wanting to build from your source code will have to deal with the multiple environments' idiosyncracies in building standalone binaries.
Some upsides are that interprocess synchronization does not have to be particularly computationally or bandwidth intensive (there are terse/fast serialization tools available), and you can distribute the runtimes across multiple processors, multiple systems, or both.
Personally, I think that with computational power increasing, this kind of "heavyweight threading" (pardon the abuse of the terminology) seems a lot less painful for the advantages it can bring. -
Re:Take Java seriously
GC systems in a similar steady state tend to roam all over their heap, touching lots of pages. This can cause the OS to keep more physical pages mapped to the process's virtual memory space, even though the process isn't actually using more memory.
Not necessarily. Modern GCs tend to take advantage of the generational hypothesis which suggests that most objects die young. One can code with generational GC with fast handling of deaths in the "nursery" of recently-created objects in mind.
A typical generational GC with two generations of old objects and a nursery works like this.
You maintain four pointers:
G1, the top of the oldest generation.
G0, the top of the 2nd oldest generation.
FREE, the top of the nursery.
CEIL, which limits the size of the heap.
At initialization, the first two of these all point to the bottom of the heap.
CEIL will point to a memory location half way between the bottom and the top of the heap, or higher.
Set FREE to CEIL, so we begin allocating in of the top of the heap.
When we allocate an object, we simply increment FREE.
When FREE reaches the top of the heap, we collect the nursery.
We do this by sliding down all live objects between FREE and the top of the heap to the area between G0 and CEIL.
In a tracing GC system, live objects are those pointed to by the roots (registers, for example, or live stack frames) as well as objects in the older generations. We can optimize the identification of the latter by maintaining a write barrier on the older generations, which tells us whether a section (perhaps a page) in the older generation was touched since the last garbage collection. A page which hasn't been touched since the last gc cannot point to live objects in the nursery. A page which has been touched might point to live objects in the nursery, so we have to trace the pointers in the page as if they were roots.
The slide-down relocation is usually done by copying the object and leaving behind a forwarding pointer. In the case of linked lists and the like, the lists are walked recursively, often breadth-first, although depth-first can give better locality of reference.
During the migration of the live objects, we can increment G0 as we go, reusing the allocation mechanism, or we can adjust G0 after the slide-down relocations are finished. Either way, when we are done, we have expanded the area between G1 and G0, and no longer care what's above CEIL. If there is sufficient space between G0 and CEIL, we set FREE to CEIL and operate as usual.
If we are tight on space between G0 and CEIL we can either expand the heap (and increase CEIL) or we can collect one or both of the older generations. Again, we identify live objects and slide them down to the earlier generation.
In the case where we are creating lots of short-lived objects we are doing very little copying during the nursery collection -- we can end up effectively doing nothing but writing objects into the top of the heap then resetting the FREE pointer when we get there. If there are many more pages between CEIL and the top of the heap then yes we will be touching more pages than if we had a very disciplined explicit allocate-and-free mechanism. If our nursery is small, however, that is not the case.
There are other ways of handling the nursery, including the Cheney on the MTA approach of using C's runtime stack (alloca() and friends) to store young objects. We still have to find and live objects when our nursery gets too large, but the C "return" reclaims all the dead ones. The implementation is straightforward for a continuation-passing-style language compiled into C, works well with small nursery sizes, and has been implemented in the Chicken implementation of Scheme.
Optimizing the speed of nursery handling, and partitioning the -
Re:Image editing..
Have you ever seen a Platinum/Palladium print? Live, not in a website or anything like that.
Unless inkset or laser printers start printing images with metallic silver, or silver platinite, there is no way on Earth a digital image can look as good as a fine art b&w print. Try visiting your local museum, or searching for some exibition in your area, or contact your local photography club if you have one in your area. Also, there are tons of alternative photographic processes, that range from making your own emulsions, to color images using custom color separations, to 19th century processes, that have an unsurpassed beauty.
And if you think your ultra-high-res CCD is the best thing in the world, you should definitively see a 18x10cm (5''x10''?) (contact) print.
There is no tonal range decompression, since with negative of that size, and bigger, you don't have the need to enlarge them.
Below is a url with some info on platinum/palladium printing, just a note, there is no substitute for seeing a palladium/platinum print live, when you see one, you'll understand.
http://www.pipeline.com/~tomf2468/altinstruct13.ht ml/
P.S.: someone mentioned Agfa papers, they were great, but unfortunately Agfa was split into 2 companies, and the one responsible for their photographic materials filed for bankrupcy a couple of weeks ago, so that leaves Ilford alone in the B&W materials (and Ilfochrome). -
Re:Kolmogorov complexity.
The best method I can think of to find that a number = sqrt(5pi)^(pi-1) would probably be something like this http://home.pipeline.com/~hbaker1/hakmem/cf.html
-
Re:Hydrogen grid?
Newsflash - Every operating reactor in the world 'goes critical' every day, but do they tell the public this? NO!!!Sarcasm aside, reactors go supercritical when increasing power output, subcritical when decreasing power output, and maintain criticality when running with constant power output. What you're (irrationally) afraid of is prompt criticality.
-
PRIOR ART!!
-
See also Schizoid Personality DisorderSome who may see themselves in a description of Asperger Syndrome may also want to take a look at the so-called schizoid personality disorder.
Here's a link: [Link]
There is some controversy about this. Many are inclined to speak of a "schizoid personality type" which encompasses many of the tendencies of the "disorder", but doesn't have the unhealthy connotations. Some refer to the INTP Myers-Briggs type as "Schizoid". My advice is to read it, and think about how it compares to your personality, but don't immediately diagnose yourself as having a personality disorder. If you are unsatisfied with your life, then talk to someone else.
-
Re:Ya do know that Dr. Pepper is
Nope, Coke doesn't own Dr Pepper. Neither does Pepsi. Dr Pepper may be bottled by Coke or Pepsi in different areas, depending on the agreements made with local bottlers. In some areas like St. Louis, Dr Pepper/7up has their own bottling plant.
Check here for some more information. -
Places without light pollutionHere's a list of lots of places without measurable light pollution.
;-)I'm a stargazer myself. I'm heading this weekend for a small mountain near my home (Utah), where at least the light pollution is a LITTLE less pervasive.
-
Re:What is wrong with these people?
Fixing security holes is a good idea, but it's not like they were running life support for the students or something. You make it sound like an act of negligence!
There's a legal concept called an Attractive Nuisance -
"A potentially harmful object so inviting or interesting to a child that it would lure the child onto the property to investigate."
It applies to things like swimming pools, but it should equally apply to things like computer systems so poorly maintained that script kiddies (or larval stage hackers) can easily crack them. If a pool owner is legally responsible for some kid drowning because the gate on his fence was broken, the school district should be liable for a computer system that multiple 13 year old kids have broken into. This is as if several kids have drown in the pool.
-
Re:From ExperienceBut a camp fire shakedown?- hmm seems the urban legend filter is kicking in there.
Your filter needs some tweeking. A quick search found several links. Two are:
Pipeline (It is a long article so you may want to search on girl scout.)