1 # Writing SpringCoat, a Java ME VM
3 ***THIS ARTICLE HAS BEEN SCRAPPED, REPLACED WITH:*** (A New VM)[anewvm.mkd]
5 This is about writing an important first step for my hobby project:
6 SquirrelJME. This is something which I have dreamed of for awhile, a Java
7 virtual machine that is open source and additionally is able to run the old
8 and outdated J2ME programs which ran on the flip phones of old. This has been
9 preceded by many failed attempts, but I decided to throw everything to the
10 wind and learn how to do it by example.
14 Coming off from failures and over ambitions, what I needed to do was to
15 concentrate and simplify my efforts. My previous ideas were all glorious
16 virtual machines which would be doing native compilation and optimizations on
17 the first pass, when I only had a basic grasp on how to actually write a
18 compiler. I found myself spending too much time reworking and throwing things
19 out never getting anywhere. I was endlessly going in circles just working on
20 what was at my fancy. Before I had a stressful home life and a horrible dead
21 end job which only pointed to oblivion. Then in a moment I finally got
22 something that I always dreamed of, a full-time programming job.
24 Previously I had done many sessions of long hours programming SquirrelJME, it
25 was a program I could not stop thinking about. Now after some short
26 experiences it is something that I think about now, something that despite my
27 lack of free time I can actually do even at a slow pace. Working a full-time
28 job makes you busy and there is not really much time to do anything at all, so
29 with no organization and no plan the project was not getting anywhere. The
30 thing is, I was thinking too big and too grand but it was something that could
31 not be done because of the time I had available to work on the project. I had
32 to make a plan and I had to simplify tasks due to my limited amount of time.
34 Since working at IOpipe they used an organization tool that I knew of but I
35 never really knew how effective it was, this tool was Kan-ban. Seeing how well
36 it worked within the company I work at was pretty much the only way I could
37 see its utility. So with that, that was where my organization and tasks were
38 to be on a more overview level. I still keep personal notes and thoughts that
39 I type out, that has definitely help me also.
41 Now with limited time and the great complexity of a virtual machine, I needed
42 to start small and simple. Gone were the elaborate designs of register
43 allocation and native pointers, gone were the complexities of a garbage
44 collector. This virtual machine is going to borrow the complex elements from
45 the host virtual machine, a virtual machine which runs on a virtual machine.
46 To keep implementation of it simple, it is pretty much a completely naive
47 interpreter where speed is not a concern. At least once this naive machine is
48 to be completed it could be dissected and used as parts to build an even
51 ## Putting Together The Pieces
53 The time it took to build the code to a point where it could run basic
54 programs took two months, working slowly after work and on most of the
55 weekends. This was from mostly nothing, to something that was actually useful.
56 There are two major parts that grant the ability to run this basic program,
57 they are the virtual machine and the run-time library.
58 The part which runs the actual code is the virtual machine, this handles
59 Java's stack based byte code and remembers all of the needed state for the
64 ## Making Things Run Faster
68 ## The Finishing Touches
74 I hope this was an insight into my hobby project and I do hope that it
75 motivates you to start something that you enjoy.