Results matching “Programming”

There are so many tools and libraries out there with which to do proper game development and it is insanely difficult to choose the right combination that best fits your needs.

I've certainly tried enough, but for the time being I think that I have finally found an interesting pair that is both fun and interesting.

The Odin programming language is an enhancement on C and is a general-purpose programming language with distinct typing built for high performance, modern systems and data-oriented programming.

Together with the Raylib vendor library, this seems to be the perfect tooling to learn on my road to advanced game development.

Tip: Video tutorials by Karl Zylinski

Seems like only yesterday that I discovered this strange yet exciting new language for the web. Boy, have we come a very long way since that crude beginning twenty years ago! Thank you so very much for making my life a more enjoyable adventure into the unknown.

"Originally just a sidekick scripting language for Java, created at Netscape in a ten-day hack, it was shipped first as a de facto Web standard and eventually became the world's most widely used programming language..."

"...In 2020, the World Wide Web is ubiquitous with over a billion websites accessible from billions of Web-connected devices. Each of those devices runs a Web browser or similar program which is able to process and display pages from those sites. The majority of those pages embed or load source code written in the JavaScript programming language..."

"...In 2020, JavaScript is arguably the world's most broadly deployed programming language."

Read more about it here: JavaScript: The First 20 Years.

Long live Ferris!

ferris.gif

Any true developer worth his weight in salt has had to explore at least once and preferably many times the benefits of using the Rust Programming Language.

Decided to go out and splurge again, so I signed up for the following online course: Functional Programming in Haskell.

This is an even more serious training for experienced software developers, and I look forward to starting it in September.

Later on I can impress family and friends with such amazing one-liners like this:

pascal = map ([1,1]^) [0..]

which generates the infinite list of rows of Pascal's triangle (yawn).

Paying the extra €69 to get some so-called paper certificate sounds like a waste of money, but I think that it will encourage me to take things more seriously and do my best to complete the grueling course with flying colors.

Wish me luck.

In view of my upcoming assignment next month, it's time to get serious about the Ruby programming language. Although I already consider myself pretty good and gain great pleasure when coding amazing stuff with this wonderful language, an in-depth refresher from beginning to end would be useful and fun.

That's why I decided to give in and splurge, expanding my computer library collection by ordering the famous book.

the-ruby-way.png

This thick tome of more than seven hundred pages is the perfect medicine for me. It also looks real nice next to all my other Ruby books. I've now read about a third of this book and am sawing through it nicely with speed and agility.

the-haskell-road-ro-logic.png
Order the book yourself

Have I gone too far and lost totally my wits by purchasing this book? Now I am going to have to read it and sludge through the jungle of mathematical proofs in order to get my money's worth. Who knows if I will ever be able to understand it completely.

PureScript-By-Example.png

Curious to find out what the differences are between PureScript (a small strongly typed programming language that compiles to JavaScript) and Elm (the best of functional programming in your browser).

Then I need to decide which one to use. First have to figure out what this whole functional programming ruckus is all about, especially as it applies to the wonderful world of JavaScript.

I figured that it was high time that I finally sit down, roll up my sleeves and really figure out at a deep philosophical level what this whole functional programming languages paradigm is all about.

What better way to do this than by wrestling with the big bad bear of them all called Haskell?

So I went out and bought a book online that claims to once and for all explain clearly how it works, all the way through functors, monads, etc. I barely survived the first chapter about lambda calculus, and it's starting to get very interesting (though heavy-going at the same time). They claim that learning Haskell doesn't have to be difficult, but I've still got thirty odd chapters to go.

haskell-book-cover.png
Haskell Programming from First Principles

Add this to the collection of all my other books about Haskell, and you could say that I'm on my way to becoming the nerdiest functional programmer around.

Eat your hearts out all you Elixirians and Clojurians.

RESTful Rails Development by Silvia Puglisi

I couldn't resist the great book offer that the kind folks at O'Reilly emailed me, so I splurged and purchased the e-book called RESTful Rails Development by Silvia Puglisi.

Although I may fool myself into believing that I am some kind of expert and this is already all very familiar material, it's always good to refresh one's mind. Perhaps even discovering new information or coming across eye-opening code snippets. Rails, REST and Ruby, yeah sure I already know all that stuff. Or do I?

Coding years on end without keeping track of new stuff can be compared to driving a car your whole life and thinking that you are perfectly competent when actually you have unknowingly become a bigger danger on the road than you realize.

Be careful before you accidentally kill your fellow developer who is pair-programming next to you. Like I always say (sorry if I keep repeating myself too much), I am never too old to learn new stuff.

The book is still the early release raw and unedited, but I still found that there were way too many errors and typos. Sure the price was right and I should not have high expectations, but when you get into the flow of reading and are regularly disrupted by unclear and misspelled words, it's a bit of a hassle.

Especially when code fragments are wrong, I hate it when there are code typos. You never know if that is how it's really supposed to be or if it is an error, until you fire up irb or vi, type it all in yourself and (if there are no syntax errors) running it.

For example, seeing '{ :product_id => 2 }' all over the place instead of '{ :product_id => 2 }', now that's pretty aggravating.

Although the English isn't fluent, the contents and descriptions are done quite well and the story-line is very complete. I just hope that in the coming newer releases that the errors will be fixed and the sentences made to flow better.

In Elixir, the pipe operator '|>' takes the output of the expression on the left of it, and feeds it in as the first argument to the function on the right of it.

You can even tag on additional functions together in an endless chain to form a pipeline of functions to be called, very similar to the Unix method of piping command utilities together, e.g. 'ps ax|grep vim|awk '{ print $1 }'.

In other words, the following statement using the pipe operator |> :

f( a ) |> g( b ) |> h( c )

is equivalent to:

h( g( f( a ), b ), c )

This can be extended to include functions with multiple parameters like this:

f( a, b ) |> g( c, d )

being equivalent to:

g( f( a, b ), c, d )

See if you can figure out what the following does:

-5 |> abs |> Integer.to_string |> IO.puts

Here's a small hint to help you along:

IO.puts(Integer.to_string(abs(-5)))

Here are some references in which you might be interested:

No I didn't forget. The answer is 5 of course.

One should not take the precise definition of 'undefined' too non-nonchalantly as it forms an important basis for understanding the JavaScript fundamentals. I'd be curious to know how many so-called expert JavaScript developers really understand what it is. In my many years of learning the ins and outs of the JavaScript programming language, this is perhaps the best explanation of 'undefined' that I've ever heard.

"When I declare 'var a', 'a' is placed into memory during the creation phase. So the execution context saw 'var a' and setup 'a' in memory. And so even though I haven't set it to a value, the JavaScript engine, which is doing more than what I'm just writing in my code, already set it to the special value called 'undefined'. So 'undefined' is not like empty, or doesn't exist, it doesn't literally not exist. It's actually a value, it's actually taking up memory space. It's a special keyword, a special value that means this is the value that was initially set by JavaScript. And that leads to a little bit of a warning... Never set yourself a variable equal to 'undefined'. Because actually you can... That's perfectly valid JavaScript, but it's a little dangerous. It's better to let 'undefined', that special keyword, mean I, the programmer, never set the value..."

undefined-javascript.png

"... That will really help you when debugging code. If you make a habit of setting values equal to 'undefined', then it's really hard to tell if something is 'undefined' because you set it or because the JavaScript engine set it and you never set it to anything else. It's always better to let 'undefined' mean I never set this value. That's really useful, and it will help you in your debugging. So 'undefined', this is a special value, that is also a special keyword in JavaScript, and it's the value that variables receive during the creation phase, the first phase of creating an execution context, sets up the memory of the variable, and in that memory space puts the value called 'undefined'. I would have called it something else personally like 'not set' but that's what JavaScript calls it, 'undefined'. And if you don't in your code set it to anything else, that is what it will be. Or if you set it to something else later, and use it beforehand that is what it will be. Alright, so that's JavaScript and 'undefined'."

JavaScript: Understanding the Weird Parts, Lecture 11: Conceptual Aside: JavaScript and 'undefined'

The absence of side effects means that we can parallelize our software programs.

The technical term for memory areas that can be modified is mutable state. Erlang is a functional programming language and has immutable state.

If you use a conventional programming language such as C or Java to program a multicore CPU, then you will have to contend with the problem of shared memory.

In order not to corrupt shared memory, the memory has to be locked while it is accessed. Programs that access shared memory must not crash while they are manipulating the shared memory.

In Erlang, there is no mutable state, there is no shared memory, and there are no locks. This makes it easy to parallelize our programs.

jaerlang2_xlargecover.jpg
Programming Erlang (2nd edition)
by Joe Armstrong

For a couple decades we have been able to take a free ride on the technological advances in speed and performance of improved hardware capabilities. First there was the 386, Pentium, Pentium 4, Dual-Core Titanium 2, and on and on. If your software was a bit slow at first, just wait a few months or maybe even weeks and the next generation of hardware will become so much faster that you won't have to worry any more about possible hiccups or performance dips.

However, this is changing faster than you realize so be careful. While this does not mean that Moore's Law is no longer valid, it does mean that the software we write will need to be concurrent in order to fully exploit CPU throughput of multi-core and distributed systems.

"If you haven't done so already, now is the time to take a hard look at the design of your application, determine what operations are CPU-sensitive now or are likely to become so soon, and identify how those places could benefit from concurrency. Now is also the time for you and your team to grok concurrent programming's requirements, pitfalls, styles, and idioms.."

"A few rare classes of applications are naturally parallelizable, but most aren't. Even when you know exactly where you're CPU-bound, you may well find it difficult to figure out how to parallelize those operations; all the most reason to start thinking about it now. Implicitly parallelizing compilers can help a little, but don't expect much; they can't do nearly as good a job of parallelizing your sequential program as you could do by turning it into an explicitly parallel and threaded version..."

"Thanks to continued cache growth and probably a few more incremental straight-line control flow optimizations, the free lunch will continue a little while longer; but starting today the buffet will only be serving that one entrée and that one dessert. The filet mignon of throughput gains is still on the menu, but now it costs extra--extra development effort, extra code complexity, and extra testing effort. The good news is that for many classes of applications the extra effort will be worthwhile, because concurrency will let them fully exploit the continuing exponential gains in processor throughput...

Taken from the article The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software by Herb Sutter.

more-books.png

You'd think that by now my head would be crammed full enough and there wouldn't be much more room left to learn even more stuff. Yet as this fine and shining pile of books keeps staring at me, I cannot resist sawing through even more interesting books in order to explore more complicated jungles of thought.

These should keep me busy for some time to come, but it being fun reading I think I'll saw through them in no time. Eleven is my lucky number anyway.

The future is uncertain, but I remain adamant and well-prepared for whatever might come my way.

That's why I decided to sharpen my programming skills further by refreshing my knowledge of Ruby, Rails and Ember. Lots of reading and practicing to do, great stuff to look forward to figuring out.

Long live convention over configuration.

I'm never too old to learn new stuff. Perhaps I should just retire early and become a gardener for fun and relaxation (not).

I couldn't have created this blog of mine without the help of the following fantastic technologies. Therefore they deserve to be given credit and I list them below for all to see.

apache-logo.png mysql-logo.png centos-logo.png perl-logo.png movabletype-logo.png jquery-logo.png

How far can we push things the Ruby way? Here's an elegant Ruby one-liner for the fibonacci function. I was secretly hoping that it would go on and on forever spewing out endless rows of digits until the end of time, but that was not going to happen.

kiffin@F5SL:~ $ irb
irb(main):001:0> fibonacci = Hash.new{ |h,k| h[k] = k < 2 ? k : h[k-1] + h[k-2] }
=> {}

Function defined and working...

irb(main):002:0> fibonacci[10]
=> 55

Let's go deeper ...

irb(main):003:0> fibonacci[100]
=> 354224848179261915075

And deeper ...

irb(main):004:0> fibonacci[1000]
=> 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875

Even more deeper ...

irb(main):005:0> fibonacci[5000]
=> 3878968454388325633701916308325905312082127714646245106160597214895550139044037097010822916462210669479293452858882973813483102008954982940361430156911478938364216563944106910214505634133706558656238254656700712525929903854933813928836378347518908762970712033337052923107693008518093849801803847813996748881765554653788291644268912980384613778969021502293082475666346224923071883324803280375039130352903304505842701147635242270210934637699104006714174883298422891491273104054328753298044273676822977244987749874555691907703880637046832794811358973739993110106219308149018570815397854379195305617510761053075688783766033667355445258844886241619210553457493675897849027988234351023599844663934853256411952221859563060475364645470760330902420806382584929156452876291575759142343809142302917491088984155209854432486594079793571316841692868039545309545388698114665082066862897420639323438488465240988742395873801976993820317174208932265468879364002630797780058759129671389634214252579116872755600360311370547754724604639987588046985178408674382863125

Deeper still ...

irb(main):006:0> fibonacci[10000]
SystemStackError: stack level too deep
	from /home/kiffin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86
Maybe IRB bug!
irb(main):007:0> 

Oops, we went too deep.

The moral of the story is that although Ruby is an elegant and amazing programming language with endless possibilities, even it's magical powers are not limitless.

Now that I have a bit more time on my hands, I decided to get crazy about the ruby programming language. I've always wanted to learn more about this intriguing language as well as the ruby on rails web framework.

crazy-about-ruby.png

As if all that reading material is not enough, I've also been following a couple of online courses, namely:

I also purchased RubyMine which is an advanced IDE to make me even more productive, though it is a bit sluggish but should be alright once I buy a new laptop.

I'm never too old for learning new and interesting stuff.

Learning the ML programming language is a lot of fun. This is my first in-depth initiation into the exciting world of functional programming. Here's something to whet your appetite, an elegant function for appending two lists of any type:

fun append e =
    case e of
        ([],ys) => ys
      | (x::xs,ys) => x :: append(xs,ys)

Here we are passing the function append an expression e, and if the pattern matches empty string plus string we stop, otherwise we prepend the first element to the tail appended to the list.

I am following the online Coursera training by the University of Washington called Programming Languages given by Dan Grossman.

Great stuff to keep my aging brain cells oiled and running efficiently.

I am convinced that the new programming language called Clojure has alot of potential and if successful will fundamentally change the way we think about developing complex applications.

Recently I purchased two books about this amazing programming language, Clojure in Action and The Joy of Clojure, and although I've read about a fourth of each book, I have not had enough time to study it as deeply as I would like to.

Here's a very simple example of how elegantly an otherwise difficult to program algorithm can be expressed in a single code statement:

(reduce + (range 1 1001))

Basically, this one-liner takes a range of numbers and adds them all together giving the total of one through one thousand and one. Show me another programming language which can express this more simpler.

Very interesting is the fact that this language is based on Lisp which is one of the earliest (functional) programming languages and is many decades old. The pendulum swings back and forth and now it is time to return to our roots. We will have to turn our linear programming mindset inside out in order to move forward.

So with that in mind, it's now time for me to go out for my daily run in the freezing cold and warm up my body and mind by philosophizing about programming computers and the true significance of simulating/stimulating human thought processes.

2  

Random entries

Here are some random entries that you might be interested in:

Recent Assets

  • ChatGPT Image Jun 29, 2025, 08_58_40 PM.png
  • norway-forty-five-years-later.png
  • murakami.png
  • funeral-pope-francis.png
  • 4-lexicon-urthus-250.png
  • 3-urth-of-the-new-sun250.png
  • 2-sword-and-citadel-250.png
  • 1-shadow-and-claw-250.png
  • to-kiffin-from-maman.jpg
  • trip-to-indonesia.jpeg
  • Kiffin-Gish-now.png
  • Kiffin-Gish-then.png

Recent Comments

  • Long time no see: I remember them, as well. I remember Donald was my ...
    - Charles
  • Bridge to the moon: Yes it was a drawing and my older brother told me ...
    - jpmcfarlane
  • Bridge to the moon: Wow, that's quite a coincidence that we both sent ...
    - Kiffin
  • Bridge to the moon: Hello I was in my teens when Gemini 4 went up that ...
    - jpmcfarlane
  • Back to work: Congratulations Kiffin, I hope it is something you ...
    - KathleenC

Golf Handicap

Information

This personal weblog was started way back on July 21, 2001 which means that it is 7-21-2001 old.

So far this blog contains no less than 2543 entries and as many as 1877 comments.

Important events

Graduated from Stanford 6-5-1979 ago.

Kiffin Rockwell was shot down and killed 9-23-1916 ago.

Believe it or not but I am 10-11-1957 young.

First met Thea in Balestrand, Norway 6-14-1980 ago.

Began well-balanced and healthy life style 1-8-2013 ago.

My father passed away 10-20-2000 ago.

My mother passed away 3-27-2018 ago.

Started Gishtech 04-25-2016 ago.