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.

Wednesday, September 24, 2008

Pain train is coming to town.

Holy cow I am very tired. In addition, the US capital markets seem to be going down quick and there isn't any real hope they will get better any time soon.

So, the quick summary is that for a long time housing prices had been rising. During this period some very questionable loans were made because *if* the house prices kept raising even if the homeoners couldn't pay the loan off the bank was left with a house that was worth more than the loan was worth. Thus from the bank's point of view it was a win-win. Huge adjustable rate loans matched to properties that couldn't drop in price.

Well the reality of the situation is that properties definitely can and do drop in prices. There is really no such thing as a safe real estate investment.

From the homeoner's point of view, when the property values rise this is awesome. Put down a 10 or 20 grand and you leverage a at least 2 or 3 hundred thousand dollars. If it rises, lets say 5% you have just about doubled your investment. This is called leverage and it really works both ways. Should it fall 5% you lost twice what you put in.

A lot of people bought houses they could barely afford in order to leverage the most amount of money they could. By barely I mean that for all intents and purposes they could not afford these houses.

Now lets say you can't really make the payments on the loan. Then you sell in the best case or default/foreclose in the worse case. If the property value has appreciated, then the bank wins whether you sell or whether you foreclose. If the property values drop, then the bank is only better off if you sell.

Lets say you have a lot of these properties. You are the bank. Now a ton of them have dropped substantially in value *and* your homeowners (odd term when there is a mortgage involved) can't pay you are screwed. Thus you lost a lot of cash.

In any case, this is probably a gross simplification but a huge amount of capital seems tied up in bad mortgages on bad properties.

The effect of banks going out of business is that everyone from you to your grandma to the farmer down the road cannot get capital easily. This will hit businesses increadibly hard because it is difficult to buy stock without capital. Thus the easier it is to get capital the easier it is to buy stock. This is also important because farmers need to buy seeds and, quite frankly for the US economy, people need to buy houses.

--digression--

A lot of stinky Europeans are talking about how much the US deserves this because we have an extremely unregulated financial market. I think this is a load of bullshit, personally. Europeans tend to be the most fiscally risk-averse people you have ever met. They like to have a single job for 1000 years and throw a fit when they might actually have to change that job. Of course our financial system is more unregulated but in the long run I think that it is probably more effective because of this. We think of all sorts of interesting ways to make money that you just can't do in Europe because the risks are too great. Every now and then there is going to be a serious correction; but at least we *can* buy a house. At least we *have* access to good fair credit.

So if you listen to a lot of BBC and various other outlets you will continually hear the reporters ask if this will lead to more regulation. I sincerely hope it will not; that regulation will make capital for small businesses harder to come by and make owning a home a much more distant proposition for millions of Americans.

--end digression--

In any case, we are going into a serious correction. This will most certainly end in a recession but it should not end with a depression. A lot of smaller businesses are going to have a hard time because they can't invest in stock required for their operation as easily. A lot of people are not going to have houses or are going to lose their houses and that is the way it is.

So lets talk about the government's buyout plan. First, let me explain my biases because I am sure they have colored my analysis of the situation.

When I hear the Bush administration talking about $700,000,000,000 of money going to someone I assume it will be the top 1% of Americans it will go towards and it looks like initially this is the case. I haven't made it into this percentage group yet so of course I think this is utter bullshit.

They want to buy the bad assets from the banks. This will let the banks off the hook and leave the taxpayer holding onto approximately $700,000,000,000 of foreclosing mortgages and poor property values. Should the taxpayer hold on to this long enough they will surely get this money back. The main question is how long is long enough and what is the real return on investment.

Notice that I didn't say they will buy the high-interest-rate ARMs from the home owners. The home owners get no protection; the banks and financial institutions get to continue business as usual. Most likely the managers of said banks will continue get their awesome bonuses just as they would have anyway and a lot of them will talk about how hard the crisis hit them to ensure the proletariate don't get too upset.

They needn't worry about it, however, as the proles will never revolt.

The Democrats in congress are attempting to provide the other side of the equation. They want some of this money to go to homeowners buy most likely refinance the sub-prime mortgages into ones that have a little more lenient interest rates.

Now, let me quickly say what is really going to happen. Should congress authorize this gigantic bill who controls all of this money of the long run? Somehow money will start flowing into some account, and some group of legislators will be put in charge. A bit of it will go towards the advertised uses; whether the banks or the homeowners. The rest will be buying the most cocaine, hookers, and bridges to nowhere you have ever seen in your life. Those senators will suddenly have amazing reelection campaigns because whoever stands to get even a little bit of that money will fucking hook a brotha up.


Which is why, at the end of the day this just will suck for a while and who knows what will happen. Everyone will say how they supported whatever solution the legislative branch comes up with and talk about how they were really working for the American people. These guys are assholes. First rate assholes.

Chris

Saturday, September 20, 2008

Blogging is hard

Writing blogs, at least for me, is one of the harder things i have ever tried to do.

I guess I imagine a reader who is as critical as I am of things, perhaps everything.

Depending on how cocky or conceited you think I am, you may consider me completely ignorant of how I sound to other people. Perhaps a few of you think that I have no idea my effect on other people or that I have no knowledge of how different I seem to other people.

I know that I come across as perhaps over-emotional and very sophomore. I also realize that I have had a really difficult time communicating the deeper things that I think about. As everyone I have ever met, I of course feel I have very intelligent, important things to talk about. Just like everyone else, however, I also know that I am an extremely poor judge of what will be considered intelligent, interesting or anything else to other people.

In retrospect, I don't find the really interesting bits of things I come up with in the blog. One of the things I really enjoy doing is shocking people with a deep or clever insight. I love the look in someone's eyes when you say something that they really consider to be abstract or interesting. It seems that my ability to do this is based, at least partly, on social circumstances. I cannot do it in writing; it is something I have to feel the flow of the conversation to really do it well.

I also feel, however, that it is at least partly rude or perhaps even violent to do it at will. Because I love to do it so much I really never considered the fact that it might upset someone or make someone feel uncomfortable. In a way it kind of rips control away from the person you do it too. A lot of times it may even be just showing off; perhaps a super sophisticated way to bully someone.

I guess the sad part of it also is that I appreciate sophistication and extremely subtle communication. Unfortunately the type of people who I would usually do it to may be exactly the type of people who would be most upset or uncomfortable with someone coming in and doing it to them.

Anyway, this is hard for me. I walk a line between trying to be unemotional enough to be intellectually stimulating while trying to also have the courage to express things that are hard for me; the expression of such does leave me a little more open than I am otherwise comfortable with.

Chris

Saturday, September 6, 2008

Amante thoughts

Back at the coffee shop, getting ready to go out tonight and having some tea and a gin n tonic.

This post is going to be quite idle, so tune out now if you have better things to do.

It occurred to me that what I really like about well-written software is its composability. The more composable a piece of software is the more options it gives people to do something cool with it.

I spoke with my father about building tools for the pathology lab and he had a superb insight. Please place this into context; my father and I are a lot alike but technical ability we don't share. He has the social ability that I lack and I have a higher order mathematical ability.

Anyway, he said that you want to make every tool as general as possible; this is what makes it useful. I didn't expect to hear that from someone who is not an engineer but it is one of the golden truths of computer science. Most likely it is the golden tool of anyone who builds and uses new tools in different ways; it then occurred to me that the diagnosis that he does probably involved quite a bit of problem solving. For some reason this never occurred to me.

This is the one primary advantage of functional programming if you are talking about the microscopic version of composability. It is also one primary advantage of open source software when are are talking about software development in the large.

I think we actually took quite a large step backwards in terms of software composability and reuse when we started compiling every down to binary. For some reason it seems that c,c++ based systems are inherently tougher to compose. Perhaps because malloc is a global, perhaps 1000 other reasons.

--context change--

It seems there is a lot of contention around garbage vs non-garbage-collected code. As far as monads and monadic forms are concerned, couldn't you consider the memory allocation system to be a monad? Isn't creating a new object implicitly changing state of the system in one way or another? Thus shouldn't every function that allocates new data use a monad passed in?

Granted this would be tedious but it would also allow you to use different memory management systems with different pieces of code.

Chris