サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
blog.jcoglan.com
If you enjoy this article, I have published a book explaining the internals of Git through implementation: Building Git. — As a programmer, you probably use a version control system such as Git, and spend an awful lot of your time looking at diffs. You use them to check over your uncommitted work in progress, to look at what changed in a single commit, to compare two branches before performing a m
Most of the open-source software that I write is done at least partly for learning purposes. The majority of it isn’t used by many people, I just wrote it to implement some existing idea, so I could understand how it works. One such project is Canopy, a PEG parser generator that I originally wrote as part of a very protracted yak shave – while writing a Capybara driver to run in the browser, I fou
After hacking away on it for months, I’m happy to announce the 1.0 release of jstest as a standalone package. jstest has long been part of the jsclass library but over time it’s become the module I use the most: I test all my other JavaScript projects with it, not just those based on jsclass. Using it as heavily as I do, I’ve noticed how its user interface can be troublesome. To being with, you ne
I was asking around to see if anyone knew a good, short explanation of Ruby’s object and method dispatch system the other day, and the response from several people was, “no, you should write one.” So, here we are. I’m going to explain how Ruby’s object system works, including method lookup, inheritance, super calls, classes, mixins, and singleton methods. My understanding comes not from reading th
The nature of promises is that they remain immune to changing circumstances. Frank Underwood, ‘House of Cards’ You will often hear it said that JavaScript is a ‘functional’ programming language. It is described as such simply because functions are first-class values: many other features that define functional programming – immutable data, preference for recursion over looping, algebraic type syste
A few months back I released faye-websocket 0.4, my first gem that contained native code. After a few mis-step releases I got a working build for MRI and JRuby, but getting there was a little tricky. What follows is a quick how-to from someone who knows barely any C or Java, to explain how to wire your code up for release. This only covers one possible use case for native code: rewriting a pure fu
In my introduction to monads in JavaScript we saw a couple of monads and examined the commonality between them to expose an underlying design pattern. Before I get on to how that applies to asynchronous programming we need to take one final diversion and discuss polymorphism. Consider the list monad that we implemented before: var compose = function(f, g) { return function(x) { return f(g(x)) }; }
(With apologies to John Gruber and A Neighborhood of Infinity.) I know, I know, the world does not need yet another introduction to monads (or yet another article complaining that world does not need yet another introduction to monads). So you’ll be glad to know this isn’t one of those, in the sense that it’s not new. I thought I’d write it because, first, monads are worth knowing about, and secon
Following on from my introduction to monads in JavaScript, and before I get into how they apply to asynchronous programming, I’d like to take a quick detour to improve the usability of the tools we’ve built up. Recall we have a function for composing functions: var compose = function(f, g) { return function(x) { return f(g(x)) }; }; // sine :: Number -> (Number,String) var sine = function(x) { ret
This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps The Deferrable pattern is a specialisation of observable objects that mixes state into the event dispatch pro
I gave a talk at London Ruby User Group yesterday, based on the work I’ve been doing on Heist, my Scheme interpreter project. I wrote the core of a basic Scheme interpreter in about 15 minutes as a live-coded demo (well, kind of – the coding was pre-recorded so I could focus on talking), which seemed to go down pretty well. If you missed it (or if you were there and want to watch it again in slow
Further to my previous post I thought I’d share the approach I’ve been using to compose DSLs in JavaScript. If you want a more involved example, check out the currently in-development Forms module for Ojay. For this example I’m going to be writing a simple permissions language that sets up rules about when certain methods may be called. It could be applied to a system for playing monopoly: TheRule
Before I start in on this: be aware I’m mostly writing this to force myself to understand something by writing it down. If you get anything out of it, consider it a bonus. I will be deriving Y() in JavaScrpit, and giving a version in Ruby. After stumbling on this article on Raganwald last year (thoroughly interesting site by the way), I was initially intrigued and then totally frustrated by not be
Update, 25 February 2008: This class is now available as part of JS.Class (it’s called MethodChain now). It also forms a key part of Ojay, an expressive wrapper for YUI. Update, 12 Dec 2007: Another implementation change. A blank ChainCollector instance now has the following properties: then, and, ____ (formerly __enqueue) and fire. The method queue and base object are private variables, and addMe
PackR is a Ruby port of Dean Edwards’ MIT-licensed JavaScript compressor, Packer: # Packer version 3.0 (final) - copyright 2004-2007, Dean Edwards # http://www.opensource.org/licenses/mit-license http://dean.edwards.name/packer/ This version is based on Packer 3.0. You may find that the results it produces are not strictly identical to those of the JavaScript version, but the difference is just a
このページを最初にブックマークしてみませんか?
『The If Works – The If Works』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く