Wednesday, October 29, 2008

Types and Languages Notes

Notes from:
http://channel9.msdn.com/shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution/

Mads is a real cool dude.

Gilad is smart but very conceited.

Eric is the man.

People coming from dynamic languages get used to typed languages that have primitive type systems.

Static typing where possible and dynamic typing where necessary.

Pluggable type systems allow type system specialization that is specific for the domain (Newspeak).

Type systems provide:
Early error detection.
Documentation
Design process as it forces structured thinking about the problem.
Quick feedback
Better intellisense on code; the extra information you put in the code helps the IDE provide better feedback.

Problem is that for new problems, the type system can get in the way.

Eric makes a point that for VB, they implemented a pluggable type system that allows intellisense on an XML document based on a schema or something along the line. This is interesting because the data you are dealing with extends the type system of the language.

Mads argues that allowing everyone to extend the language with typesystems would end up with a bablification of systems. I disagree with this; it is the standard argument that people have against adding any new feature to a language in that it "could" make the language harder to use. The same argument is used to argue against lisp type macros and lots of other really really smart things. It is always hypothetical bullshit; I have never seen a single paper that backs this argument up.

All the good stuff in computer science was done until about the late 70s.

Capability based security is based on keys. Control who actually has a function pointer to the piece of functionality that does the dangerous or protected functionality.

Not sure that I feel the rest of the article is really that productive. Gilad really dislikes the modern collection of languages.

He makes a point that inertia in languages is a really big deal. It sounds like he is frustrated which I can totally understand if you try to be a visionary in the computer languages field.

Dev tools in a purely dynamic language. The types are useful for refactoring. With a pluggable type system it really helps things out a lot. The value of the types is giving a formalism to describe things and describe new things.

The VB xml implementation is completely latebound and you still get intellisense.

Thus intellisense and type systems are completely orthogonal. A problem with Smalltalk was that it doesn't talk to the external world efficiently.

Newspeak runs on squeak. Potentially the newspeak could be ported to the CLR.

Tuesday, October 28, 2008

Playing guitar

I have decided to pick up the guitar again.

This will be approximately the 4th time I have started playing guitar after not playing for a while. A while being defined as 1 year or more.

In high school, I bought this ridiculously crappy guitar from some guy and played it like crazy. Then I got a really cool Jackson flying V guitar and played that. I believe I sold it when I was 19 or 20.

Next I didn't play for a long time. Then I moved in with people who had guitars and started playing again. Acoustic mostly but with some electrical influence.

Then I bought a really cheap guitar that had great pickups. I played it somewhat half-heartedly for a while, then gave it away to a girl who wanted to start performing.

Finally now I bought an acoustic guitar. This would be the nicest guitar I have owned in a while; it is a solid guitar for around $500. The next quality jump comes at around $1000. My theory is that if I can't earn that much money playing guitar then I am stuck with the guitar that I have.

The biggest difference this time is that I am not focusing on becoming the best guitar playing I can be. I am focusing on performance and playing for people. Somehow I believe this is the next step for me.

So I have a buddy who has already taken music pretty darn far. He has played a bunch, sings really well, and has performed at coffee shops all around Washington DC. We have decided to start a group that will play at coffee shops all around Boulder. If we find a drummer then perhaps we will actually be able to do gigs.

I have decided to take up singing, so I will probably do backup vocals and lead guitar. He will do the complement.

Now all I really have to do is learn to sing. I can barely sing right now; enough to get by but nowhere near where I want to be.

In any case, the point isn't to get all technical and precise with the music. The point for me is to meet people and make money. I don't need the money, mind you, but I look at it as vindication that we are doing the right thing. I guess the point is that I am not doing this just for myself; I have never really tried to perform anything and I would like to understand how that works. I figure if people really like what you are doing then they should have no problem paying for it.

Anyway, it is also kind of cool to be playing guitar again. It feels like I just can't really stop doing that. No matter how far I walk away from it I always come back to it. I guess I just really really love the way a guitar sounds.

Chris

Sunday, October 26, 2008

New Project

We got to version 1.0 of the product I was working on, and I am really happy with where it turned out. We stabilized the product quite well and it had a really solid feature set. Now we hand it to the marketing and sales experts and see if they can make it fly in the market we built it for. If it fails, it isn't going to be engineering related, that is for sure.

Now I will lead a small very good team of 5 people including me to add interesting features to an established piece of software.

This software is known to be unstable and quite complicated. Our job will to do whatever is necessary to add hard, intricate features to the software in a way that will not break it.

This is perhaps the hardest thing you can be asked to do in computer science. It is harder (although a lot less work) than writing your own software from scratch. You have to walk into extremely unstable territory and leave the system cleaner than it was when you first got into the problem.

Basically it is going to be a learning experience all around. I am not concerned about technical difficulties of doing what we want to do. I will use this project to test run how I want a development team to work in the long run. We fortunately have a valid problem so I feel that if we can get this working well then the development team ideas I have will be somewhat validated.

Given the most ideal situation, how would you like to run a dev team? How do you want it to feel? How would you schedule work?

I like people all focusing on similar things. When we try to solve problems I want everyone, all 5 of us checking things out and working as a real team. I guess another level is managing several teams, but I am not there yet. Managing one team well is something I have never done, but I have gotten much much closer.

Because the problems we are going to solve are very difficult, I want everyone working on each large feature (called a story) at once. We are going to all analyze the problem, come up with a solution, do groundwork to get a feel for the size of the changes, and finally think of a testing or regression strategy so we know we haven't broken anything with the newer system.

Then we will divide work and move forward. But everyone will be involved in each stage of work.

1. Come up with a possible solution.
2. Check feasability and amount of code that has to change. Perhaps move back to 1.
3. Consider what functionality will be refactored/re-written and what regression testing strategy to use to ensure we don't destabilize the product.
4. Figure out testing strategy for new code.
5. Divide up work and split into pairs or singles depending on problem.

I guess I just really want everyone on the same page. I want people to share and understand whatever overarching vision we come up with and also share in the considerations necessary to keep the product working.

More than anything else, I don't want people to work in their small corner. I have seen that work and I know that a few members of this team would happily do that but I just don't feel that model of development is how good software is done. I think it takes really open design process and lots of shared knowledge.

Anyway, what I really really want is everyone fully engaged and working with each other. I don't care what system is used, good development takes a serious team effort. I believe that is really what is lacking from the current processes that I look at; not enough good team work at the architectural and very abstract level.

Chris

Saturday, October 18, 2008

Thinking about programming

I am going to have a normal pace of life and a normal work life coming up soon. Thus I have started thinking about what the next phase of my project is.

The project is to build an environment to allow the creation of the most beautiful digital art imaginable through the use of animation, 3d, and 2d composition. The gist is to build an environment where it is easy to build scenes, animations, create really interesting effects and perhaps presentations.

This is a real-tme environment, so it will not be built for offline processing. This means that the results are fit to be used as screen savers, in games, or whatever. But it will not be able to do pixar level computer graphics.

It is to be simple enough that anyone (any digital artist familiar with photoshop) can use it but allow extreme customization and sophisticated manipulations of the scene, animations, and anything else both from the user and programmatically.

This is not a content creation tool. I am not building photoshop nor Maya but I am looking for a composition environment much closer to After Effects or a game engine.

This is also going to be a mental device to help me really figure out what the next stage of graphics is going to look like from an authoring environment point of view.

Something interesting I look forward to is building a computer with both a larrabee style compute card and a high end NVIDIA card and building a rendering environment that will be able to efficiently and interestingly use both GPUs together. Perhaps I program most of the rendering to go on the NVIDIA GPU and just use the larrabee component for extremely sophisticated blending effects.

I believe that user creation of effects, mainly fullscreen effects but hopefully also new animation methods is extremely important. You can do such amazingly cool things when you can program multi pass shader based effects that I believe having it being easy to add new ones is really the best thing you could do.

I think having powerful compositional abilities on several levels as well as extreme application extensibility is key. I want it to be able to combine several 3d assets together into a model, and I believe it is important to be able to compose multiple models together into a new, more sophisticated model. I think animations should be equally composable, although the rules for composition animations are quite complex (like transitioning from a walk to a run in a 3d animated character). Collections of animations,

Composition and extension as well as application programability are key to the success of the system. You need to be able ot compose effects, compose models. You need to be able to combine and compose animations. Given a time context and an animation graph, I believe you should be able to embed one animation graph in another as well as run with suitable transitions from one tme context to another.

Combining and composing pieces of content are key to success. The user should easily be able to create "symbols", or name their specfic compositions and should also be able to compose and group symbols.

In any case, that is the overall vision. First, I need to get some simple opengl and application datastructures working. I am not going to use c++ for the entire application, but I want the view to be in c++. This gives me easy access to a lot of application libraries and also to gtk, or anything else I want to check out.

Then there will be some interface into a higher level language. I was thinking LISP for a long tme but I think I will use Haskell instead. LISP is a very, very beautiful language and perhaps the best dynamically typed language ever invented. It represents the epicenter of programming language beauty due to is extremely programmable compiler and extremely regular syntax.

Haskell, however, represents something else. It is what people are actively researching. A lot of the most interesting research papers and written in Haskell and I believe that currently, it represents the forefront of the absolute best idea a lot of smart people have about what a programming language should be.

In short, I think that LISP is amazing and beautiful in its simplicity. I believe that Haskell represents the immediate future of a very interesting view of programming is the best language to learn moving forward if you really want to get down to the bottom of this whole language thing.

I have over the course of 2 years researched different aspects of the project. I first research xml and xml-schema very heavily because I thought I wanted the application to be built around a schema graph based on actual XML schema (with some natural extensions). I believe now, however, that the core of the system needs to be built around a custom schema graph with a custom data graph representing instantiations of objects in the schema graph.

It is interesting because a schema represents a graph generator. The data graph represents one possible instantiated graph. I believe that building the core of the data model around this design will allow for the level of extensibility I require for a good 3d data model.

If I separate the process of getting values from the graph then I can put, in essence, put caching layers or animating and processing graph layers in between the data graph and a client of the data graph (like a depiction a 3d scene).

Implementing this graph idea in c++ is relatively simple and straight forward. Implementing it in F# was pretty easy once I had a clear vision of what the schema graph, datagraph, and whole schema graph database system should look like. Now I want to implement this in Haskell and see what comes out of it.

I also need to design a protocol for keeping two data graph databases in synchronization. I would like the haskell code to be able to make arbitrary changes in the data graph and the scema graph and have the c++ implementation mirror those changes and vice versa.

This will involve a system for recording the changes being made to the database and for transferring this information down to binary and back. It will need to be a binary standard that I can implement simply in both c++ and in haskell. If I change a light property from red to blue I want to be able to send these changes and have the mirrored graph also have a light that is blue.

I will use this to communicate the windowing datastructure changes from language X to c++ and back again. Note that this will involve events as well as data updates, as a mouse click is an event and will not be represented in the graph.

In any case, I know what the data model and looks like and I know various other pieces. The next step is to research my previous work on transferring a schema and objects over a wire I did using c++ and lisp. I will probable start working on the same project again as I have such a clear vision of what it needs to be. Licada is active again.