Skip to content

Instantly share code, notes, and snippets.

☂️
Umbrella

rain1 rain-1

☂️
Umbrella
Block or report user

Report or block rain-1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mromyers
mromyers / Y.rkt
Created Feb 17, 2019
Y combinator and variants
View Y.rkt
#lang racket/base
;; Y combinator / Normal Order
(define (Yₙ f)(U (comp f U)))
;; Y combinator / Applicative Order
(define (Yₐ f)(U (comp/eta f U)))
;; Polyvaradic Y Combinator / Normal Order
(define (Yₙ* . f*) (U (mcomp f* U)))
;; Polyvaradic Y Combinator / Applicative Order
(define (Yₐ* . f*) (U (mcomp/eta f* U)))
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active Jul 30, 2019
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid
View fork-is-evil-vfork-is-good-afork-would-be-better.md

I recently happened upon an implementation of popen() (different API, same idea) using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

So here goes.

Long ago, I, like many Unix fans, thought that fork(2) and the fork-exec process spawning model were the greatest thing, and the Windows sucked for only having [exec*()](http://pubs.opengroup.org/onlinepubs/9699919

You can’t perform that action at this time.