/dpt/ - Daily Programming Thread

Old thread: Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Attached: lisp.jpg (430x299, 44K)

Other urls found in this thread:

techcrunch.com/2012/05/10/dev-boot-camp-is-a-ruby-success
benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/haskell.html
microsoft.com/en-us/research/wp-content/uploads/1992/04/spineless-tagless-gmachine.pdf
twitter.com/SFWRedditGifs

working through jonesforth and starting forth, so far it seems like every other interpreter that employs very trivial and very suboptimal solutions
planning find some real software implemented in forth to see how it's actually used, because juggling with top of stack to get basic arithmetic working is not amusing at all

>What are you working on, Jow Forums?
Functional programming in GNU Make

### List operators
slice = $(wordlist 2,$(words $1),$1)
repl = $(if $(call eq,$(words $4),$1),$3,$(call repl,$1,$2,$3 $2,$(words $4) $4))
rotate = $(call slice,$1) $(firstword $1)
map = $(if $2,$(call map,$1,$(call slice,$2),$3,$4 $(call $1,$3,$(firstword $2),$4)),$4)
fold = $(if $2,$(call fold,$1,$(call slice,$2),$(call $1,$3,$(firstword $2))),$3)
zip = $(if $2,$(call zip,$1,$(call slice,$2),$(call rotate,$3),$4 $(call $1,$(firstword $2),$(firstword $3))),$4)

### Arithmetic operators
inc = $(words $(call repl,$1,_) _)
max = $(words $(subst __,_,$(join $(call repl,$1,_),$(call repl,$2,_))))

eq = $(filter $1,$2)
gt = $(filter-out $2,$(call max,$1,$2))
gte = $(call gt,$1,$2)$(call eq,$1,$2)

add = $(words $(call repl,$1,_) $(call repl,$2,_))
sub = $(words $(filter-out __,$(join $(call repl,$1,_),$(call repl,$2,_))))
mul = $(words $(call repl,$1,$(call repl,$2,_)))
div = $(if $(call gte,$1,$2),$(call add,1,$(call div,$(call sub,$1,$2),$2)),0)
double = $(call mul,2,$1)

isqrt_cand = $(if $(call gt,$(call mul,$(call inc,$1),$(call inc,$1)),$2),$1,$(call inc,$1))
isqrt = $(if $(call gte,$1,2),$(call isqrt_cand,$(call double,$(call isqrt,$(call div,$1,4))),$1),$1)

### Main program body
head = $(firstword $2)
count = $(words $3)

loop = $(call fold,$2,$(call map,count,$(call repl,$1,_)),$3)

skip = $(call loop,$1,slice,$2)

cycle = $(call slice,$(call repl,$1,_)) 0
eliminate = $(if $(call eq,$2,0),0,$1)
sieve = $(call zip,head,$(call repl,$(call double,$1),_),$2) $(call zip,eliminate,$(call skip,$(call double,$1),$2),$(call loop,$(call sub,$1,1),rotate,$(call cycle,$1)))

dispatch = $(if $(call gt,$2,1),$(call sieve,$2,$1),$1)

n := 100
s := $(call isqrt,$(n))
numbers := $(call map,count,$(call repl,$(n),_))
primes := $(filter-out 0,$(call skip,2,$(call loop,$(s),dispatch,$(numbers))))

print = $(info $2)

### Targets
.PHONY: all
all: ; $(call map,print,$(primes))

>Camping the old thread and posting 20 seconds past the bump limit just so you can post your meme garbage
You're pathetic, OP. Yes I'm pissed off that you didn't post Anime.
How else are we supposed to keep the tone of the thread and keep the less-desirables out?

Attached: 1407303094615.jpg (588x588, 58K)

Why do we feed people this lie of like "If you learn the basics of Java, in a month you can be a six figure salaried engineer."

Stop. Unless you're Dennis Ritchie himself you need a degree.

techcrunch.com/2012/05/10/dev-boot-camp-is-a-ruby-success

Learn Lisp.

Was for obviously

Anime is not technology user.

>oppic
Absolutely disgusting. This thread is cursed.