AJAX || +Singularity @ Lambda
New Cheatsheet: What's Ajax?
By amy on ajax
Have I been workin' hard, or hardly workin'? It's a good question. Either way, I've been hacking away an Ajax chapter for the book. Ajax has been becoming one of my very favorite topics, if for no other reason that there is very little writing out there, so far, which makes it as simple as it really is. Plus it's just freakin' cool.
Cheatsheet
What's Ajax? (PDF) is my attempt to cut away as much of the Ajax smoke & pixie dust with a single page. As for the theme, I was inspired by the font (Big Bloke BB). Let me know what you think!
Ajax Interface Example
I've also created a little example movie of an Ajax interface I got to create at work for Ning. If you're working on adding some kind of in-line editing to your applications, you might find it useful. I should have typed less since it was a demo movie, but I was going for realism (translation: I wasn't thinking, and am too lazy to redo it).
Note: The techniques shown in the video are not the same as edit-in-place (EIP). The form is generated by hand-coded Javascript; edit-in-place is somewhat less fancy and it involves less custom work.
Downloads
What's Ajax? cheat sheet (PDF)
Ajax photo sharing app interface (MOV)
Links for Cheatsheet
added 10/30/05—thanks, Jamal
=============================
http://lambda-the-ultimate.org/
An Overview of the Singularity Project
Singularity is a research project in Microsoft Research that started with the question: what would a software platform look like if it was designed from scratch with the primary goal of dependability? Singularity is working to answer this question by building on advances in programming languages and tools to develop a new system architecture and operating system (named Singularity), with the aim of producing a more robust and dependable software platform. Singularity demonstrates the practicality of new technologies and architectural decisions, which should lead to the construction of more robust and dependable systems...
Singularity... starts from a premise of language safety and builds a system architecture that supports and enhances the language guarantees.
An interesting overview of what sounds like an intersting project.
The choice of implementation language is also interesting:
Singularity is written in Sing#, which is an extension to the Spec# language developed in Microsoft Research. Spec# itself is an extension to Microsoft’s C# language that provides constructs (pre- and post-conditions and object invariants) for specifying program behavior. Specifications can be statically verified by the Boogie verifier or checked by compiler-inserted run-time tests. Sing# extends this language with support for channels and low-level constructs necessary for system code....integrating a feature into a language allows more aspects of a program to be verified. Singularity’s constructs allow communication to be statically verified.
An interesting aspect is the support for meta-programming, which is implemented in an unusal manner:
Compile-time reflection (CTR) is a partial substitute for the CLR’s full reflection capability. CTR is similar to techniques such as macros, binary code rewriting, aspects, meta-programming, and multi-stage languages. The basic idea is that programs may contain place-holder elements (classes, methods, fields, etc.) that are subsequently expanded by a generator.
Many other intersting design decisions are discussed in the paper (e.g., various DbC facilities), so do check it out.
Syntactic sugar causes cancer of the semicolon, and other Alan J. Perlis epigrams
The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities. -- Edsger Dijkstra, How do we tell truths that might hurt?
...there is no agreement on what a programming language really is and what its main purpose is supposed to be. Is a programming language a tool for instructing machines? A means of communicating between programmers? A vehicle for expressing high-level designs? A notation for algorithms? A way of expressing relationships between concepts? A tool for experimentation? A means of controlling computerized devices? My view is that a general-purpose programming language must be all of those to serve its diverse set of users. The only thing a language cannot be – and survive – is a mere collection of ‘‘neat’’ features. -- Bjarne Stroustrup, The Design and Evolution of C++
I think that any language that aspires to mainstream use must provide a broad base for a variety of techniques -- including object-oriented programming (class hierarchies) and generic programming (parameterized types and algorithms). In particular, it must provide good facilities for composing programs out of separate parts (possibly writing in several different languages). I also think that exceptions are necessary for managing the complexity of error handling. A language that lacks such facilities forces its users to laboriously simulate them. -- Bjarne Stroustrup, LinuxWorld
There is a race between the increasing complexity of the systems we build and our ability to develop intellectual tools for understanding that complexity. If the race is won by our tools, then systems will eventually become easier to use and more reliable. If not, they will continue to become harder to use and less reliable for all but a relatively small set of common tasks. Given how hard thinking is, if those intellectual tools are to succeed, they will have to substitute calculation for thought. -- Leslie Lamport.
let me re-assert that the question of whether there are limitations in principle of what problems man can make machines solve for him as compared to his own ability to solve problems, really is a technical question in recursive function theory. -- J. McCarthy, Towards a Mathematical Science of Computation .
Until real software engineering is developed, the next best practice is to develop with a dynamic system that has extreme late binding in all aspects. -- Alan Kay, Is Software Engineering and Oxymoron? In the Croquet User Manual.
Greenspun's Tenth Rule of Programming: Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp. -- Philip Greenspun.
============================================
http://www.joelonsoftware.com/items/2005/10/14.html
From the Good-Intentions Department
When you see an error in the Windows Event Log, there's always a handy URL that you can click for up-to-date, detailed information about why you got that error, especially since most of the errors you see in there are completely incomprehensible.
Does it work? For really common problems, it gets you an official explanation from the documentation, but it never seems to really have useful information about what caused the problem. Every time I've ever clicked it, I've gotten this:
========================
http://www.zeldman.com/daily/1005g.shtml
Ma.gnolia
“Found is the New Search,” the page proclaims. Zen koan? Nope. George Orwell outtake? Uh-uh. It’s the thought-provoking slogan of Ma.gnolia, an upcoming social bookmarking service now in pre-launch, sign-up mode.
The temporary site’s design is not only lovely, it is also unusual, suggesting levels of thought and depth rarely seen in the category. What a pity this beautiful mini-site will have to die!
I know something about the product that’s coming, and look forward excitedly to its release. You might want to sign up.
=======================
http://www.xmldatabases.org/WK/blog/1961_New_programming_languages.item
New programming languages
Lot's of interesting programming languages have been popping up lately. Groovy has been one that initially caught my interest and now there's a new language called Boo that looks really interesting. Boo is a language that targets the CLR, but has syntax based on Python. It's not out to make a Python clone, just to have a similar syntax that can leverage the class library and other facilities available through the CLR. It's a really interesting language and runs just fine on top of Mono on Mac OS X.
Another language that looks interesting is from Microsoft Research and is now called Comega. This is an evolution of the language that used to be referred to as X#. This language also targets the CLR and has integrated direct support for XML within the language syntax. I'm dying to have a usable language with tight XML integration so it's good to see progress in this area. Unfortunately, Comega is based around the concept of strongly typed XML which is something that I think defeats the whole point of using XML. Also in typical Microsoft fashion the compiler is available in a format that can only be installed on Windows. So far I haven't been able to try it out to see if it works on Mono. Well, actually I did try to install it on a Windows machine but the installer just silently fails so even that was unsuccessful. I suspect it's looking for the .Net framework or something else that isn't installed on that machine, but there's no information at all on what it requires. Anyway, the compiler download isn't actually linked from the Comega site as far as I can tell so you have to go to the download section on the Microsoft Research site if you want to get it. If it turns out it will run on Mono I'd love to hear about it.
Posted by Kimbro Staken
Saturday Jul 17, 2004 at 3:15 PM===============================
http://weblog.ikvm.net/PermaLink.aspx?guid=b28aa8b7-87e3-49d7-b0aa-3cc2cb5dbac9
Frozen Strings are Cool
First off all, sorry for the bad pun, but I couldn't resist. Once Whidbey ships, one of the areas that .NET will be light years ahead of Java is the ability to share memory between different instances of the runtime. Microsoft did lots of work in Whidbey to enable sharing of memory pages (e.g. see Rico's post). Sun did a little work in J2SE 5.0 to allow rt.jar to be shared across VM instances, but that's really not much compared with the sharing that NGEN enables on Whidbey.
Frozen Strings
One aspect that hasn't been written about much is the ability to pre-create string instances in NGENed images. What this means is that string literals are layed out in the .data
section of the NGEN image exactly like they would be layed out when they are dynamically created by the CLR. So whenever you use a frozen string literal in your managed code you're simply passing around a pointer to static data in the NGEN image and not to an object in the GC heap. Since these strings live in the .data
section of the image, the standard copy-on-write page sharing that the operating system uses for initialized data sections in images applies, so unless you modify the object somehow (more about this in a bit) all applications using that image will be sharing the same physical memory pages.
To get NGEN to create frozen strings for your string literals, you have to mark your assembly with the StringFreezingAttribute
. Note that the downside of doing this is that your assembly will not be unloadable, because the frozen string instances that live in your image aren't tracked by the GC, the CLR needs to keep the image loaded for the lifetime of the process.
Copy-on-Write
Strings are immutable, so why did I mention modifying the object earlier? One obvious way to modify a string is to use unsafe (or native) code to poke inside the string (a really bad idea!), but there are other ways of "modifying" immutable objects. The first is to use an object as a monitor (using Monitor.Enter
or the C# lock()
construct) and the second is to get the
object's identity hashcode by calling System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode()
or doing a non-virtual call to Object.GetHashCode()
on the object. Using an object as a monitor will cause the object header to be used as a lightweight lock or as an index into the syncblock table that contains the heavyweight lock, so this can mutate the object (header). Locking on string literals was always a bad idea, because they're probably interned so they may be shared by other pieces of code that you don't know about and they can also be passed across AppDomain boundaries, but in Whidbey there is the additional (potential) cost of having to take a page fault and having to make a private copy of the page containing the strings object header, if the string is frozen. The second issue (identity hashcode) turns out not to be an issue for frozen strings, because NGEN pre-computes an identity hashcode for frozen strings, so RuntimeHelpers.GetHashCode() will simply return the value that was pre-computed and stored in the object header. =====================
Geek Halloween Costumes | |
11. | Cat5-Woman |
10. | A hard drive eating boot sector virus |
9. | TPS report, with wrong cover sheet |
8. | A blocked pop-up ad |
7. | The 40-year-old virgin |
6. | A network server with hot-swappable pants |
5. | P2P pirate |
4. | A 7-in-1 card reader |
3. | A mushroom |
2. | A Blue Tooth earpiece |
1. | An iPod Nano complete with scratches and class action suit |
0 Comments:
Post a Comment
<< Home