![]() Considering the already complex nature of WebKit, I ended up abandoning most of performance optimizations to keep the complexity under control. I learned a lesson that I must pay very high costs of complexity to get small benefits of performance boost. So I offloaded some tasks to separate threads but I only gained marginal performance benefits in exchange for largely increased complexity. Loading a page does not benefit much from having a multi-core CPU. WebKit performs lots of tasks concurrently but it is mostly single-threaded. The primary means for optimization was to leverage the multi-core CPU and GPU. I created a port of WebKit and hacked various components of WebKit to speed up the performance. I built mobile web browsers for the embedded systems. In the meantime, I changed my career and founded a tech start-up in 2008. I managed to write simple applications in Haskell, but wasn’t confident that I could use Haskell productively because I couldn’t fully understand one of the core ideas of Haskell. But I couldn’t figure out how they were related. It wasn’t very hard to understand specific instances of monads such as Reader, Writer, State, List and Maybe. I read A Gentle Introduction To Haskell and many tutorials on monads. Stuck againīy fully understanding the merits of type systems, I started to learn Haskell in a different perspective. ![]() I understood why types were important in statically typed functional languages like Haskell! If universities had used this book as a undergraduate PL textbook, many of the confusions and misunderstandings about dynamic vs static typing would have disappeared. It was the best computer science text book I’ve ever read. Pierce’s Types and Programming Languages. These experiences motivated me to find systematic ways of preventing bugs and led me to read Benjamin C. It was relatively fun to fix a bug in Java applications. Dead locks are reported systematically by the JVM. A Java program can’t corrupt memory and crash the system. Thanks to the safety guarantee of Java, certain types of bugs were impossible. The situation was much better when debugging an application written in Java. ![]() It took hours or even days to find and fix a trivial bug. Moreover, because there were dozens of threads competing for shared resources, race conditions and dead locks were a common place. A bug in an application could corrupt the kernel data and crash the entire system. I had no safety guarantee provided by modern operating systems. These RTOSes didn’t have distinctions between kernel and user space and an application was linked statically with the kernel and ran as a single (kernel) process application on the device. RTOSes such as pSOS and VxWorks were popular on STBs and I ported JVM to these OSes. It was 2002 and Linux was still a luxury for embedded systems. My company licensed Sun’s CDC JVM and I was responsible for maintaining it. My first job was mainly about porting and optimizing Java Virtual Machine for embedded systems. However, I wasn’t sure if Haskell could solve the real-world problems I wanted to solve. Haskell: the Craft of Functional Programmingīoth books were really nice and I learned I could program in an entirely different way.I wasn’t interested in functional programming at that time, but I became curious because he enthusiastically persuaded me to learn Haskell. #Use of haskell programming language codeI was proud that I understood how my code was compiled and executed on the machine. My primary language was C and programmed all programming assignments in C. At that time, I was into system programming and enjoyed learning low-level implementation details of operating systems and system applications. First Encounterīack in 2000, I was an undergraduate student majoring in computer science. It’s been a really long journey but a really wonderful one. Happy lunar new year! Today I would like to share my experience of learning Haskell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |