/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.

This is the technology section of an anime website.
Anime is always relevant.

Attached: 1374575428855.jpg (1280x720, 113K)

wasm

Attached: 1558574064559.png (489x941, 387K)

>Anime is always relevant
This.

>Anime is always relevant.
Anime is an integral part of life.

Anime is love.

Attached: Ai Hinatsuru.gif (600x338, 1.45M)

lolis are life

And I love you :3

Attached: fabc32da79726248ca348fd035f8a9fa.png (647x888, 481K)

kys pedo degenerate

seethe

Attached: 1465921124051.png (378x397, 206K)

I love you to user!

Attached: 1560243801429.jpg (750x761, 318K)

imbecile

cope

Attached: 1492163498551.png (272x423, 49K)

NOBODY LOVES YOU AND YOU WILL DIE ALONE YOU UGLY FAT FUCK

Better to die alone than to live the life of a miserable creature like you :^)

>being a dumb attention whoring anime pedo scum
>calling someone a miserable creature
poetry

>getting offended by cartoons
lol

Attached: c547fd67f90c53f1a85892b74681cde9.jpg (1010x780, 394K)

dilate

Attached: 1448480448764.jpg (409x500, 28K)

that OP isn't really programming related is it

>he doesn't know about lisp

There, there... Have a (you), poor soul thirsting for attention on anonymous basket weaving forum.

Attached: よしよしヾ(・ω・`).gif (476x498, 304K)

I don't even know why I'm staying here anymore, there is no programming happening in these threads. Only retards arguing about retarded shit.

why would you do this to yourself

>implying

Attached: 1549675254567.jpg (600x600, 108K)

The unironic answer is that I wanted to demonstrate to Haskell fags how retarded they look by insisting on functional programming only and never anything else.

you're here forever user, don't forget that

Attached: 1555713348745.png (1163x943, 619K)

but you're proving them right by demonstrating the power and flexibility of functional programming in something as goofy as GNU Make

is that your idea of powerful

i don't think it has the intended effect then

Attached: 1540046711326.jpg (600x1000, 147K)

Can somone redpill me on why lisp is based

I'm proving that functional programming can be done in any language, even one that doesn't have basic arithmetic operations, and that there's nothing inherently special about Haskell.

code as data

Haskell is special because of its type system and purity, that's kind of the whole point

Talking shit about programming is what this thread is for. If only because programming itself is shit.

And what's impure about the code posted in ?

This. TDPT, or /dpt/ as it has become know as, was always intended as a containment thread back in the days when programming was discouraged on Jow Forums.

What does that mean

It's easier to get attention from anime posting or bait than from working on actual projects. We probably keep going back here because anonymity is the only way to keep our sanity.

Learning python after lisp here.

God damn it I already mix prefix notation and I am so fucking confused by some python design choices it's unreal. Urgh.

Attached: giphy (5).gif (830x641, 3.39M)

Haskell is designed to facilitate writing using FP style. And to be a playground for research (all this LANGUAGE directives).

>a playground for research
cringing hard at this

>a playground for research
Cringe aside, the literal only way to actually program in Make is by functional programming though.

It means you can pass literal code into functions that can rewrite it.
Because I've conflated GHC and Haskell?

Because it sounds like something only some computer scientist circlejerk would say.

Nothing, but afaik make allows for state, which is impure. it also doesnt have a type system.

because people consider making shit programming languages "research"

Well, that is what people who write GHC say, so...

benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/haskell.html

What's the point of FP if it's so slow? All you need is math and C.

it means the code can be passed around and manipulated like data
not limited to just lisp btw

>Nothing, but afaik make allows for state
It doesn't, the only state it (usually) allows for is file modification timestamp.

>it also doesnt have a type system.
You can make one, just like you can make arithmetic operations.

>benchmarksgame
kill yourself

>I'm proving that functional programming can be done in any language
yeah well a homosexual and an institution already proved that in the 30s

>there's nothing inherently special about haskell
that's correct, no one claimed the opposite
although it is very _different_ from most other programming languages because of its type system, enforced purity and laziness.

You have to try and make shitty stuff before you could distill anything of value, though. Same applies to research.

>You can make one
so it doesn't have one...
I mean anyone can just make anything on top of any programming language

>enforced purity and laziness.
These two are actually shared by Make, which is why it is a suitable comparison.

The type system is a fair argument though.

Attached: guidosicp.png (601x623, 100K)

>I mean anyone can just make anything on top of any programming language
Isn't that the argument Haskellers use themselves though? That you can make anything by using the powerful typing system?

>What's the point of FP if it's so slow?
To write correct and formal code, not to write fast code.

>You have to try and make shitty stuff before you could distill anything of value
I disagree
I think you should try and make useful things first and start from there
You know, like every single other programming language people use

and sepples fags about their templates and (((lispers))) and pythonistas and typelets because muh reflection, etc.

make's type system can't be compared to Haskell though, that's a big difference

what is your definition of correct
what is your definition of formal

>retard saw the haskell is useless video on his feed once

Why common lisp is dead?

Just because a particular implementation of a particular langiage in a particular case ends up being slower than another particular implementation of another particular language in that same case in no way implies FP has to be slow in princiole, because it has been formally proven not to be.

are you an ESL? these are pretty basic words

So, there's a new C++ standard coming out soon. And a bunch of others in regular use. Which one is the boss with the best weapon?

Should I learn Lisp if I hate Jews?

linear types will save benchmarks

Cope

nope, i am curious what you believe these words mean in this context.

Well, yes. But Haskellers are exceptionally vocal about it, calling it stuff like "a playground for research" etc.

I don't disagree.

know your enemy

Attached: 1534524589463.png (850x817, 793K)

>functional programmer buttmad that even the author of the language admitted it was useless and just a prank to confuse brainlets

You're more or less ok with anything from C++11 and beyond. The additions of 14 and 17 are straightforward to incorporate starting from 11.
Avoid older standards like the plague unless you absolutely have to (for example, having to work with legacy code).

people develop it so i would not consider it dead
why would it matter anyway?

It's not?
It's not as popular as say, java or python, but it certainly isn't dead. You'll probably have less package provided to program in common lisp but the language is so powerful you don't need those more often than not.

Don't be too scared, Lisp is still worthwhile to learn, it makes you smarter once you get it.

because that was the point of haskell, having a hackable implementation of a functional lazy programming language that researchers could "play" with.
Back in the time it was all about _lazy_ functional programming.

Sold.

why would a person's intuitive grasp of such basic regularly used words come in the form of a "belief" about the accuracy of a formal definition?

yes, I'm so assblasted you could fit your mom in it

That actually sounds sick, what other languages support this and how efficient is it when compiled?

Haskell is useful. I wrote a web-service in it ~ 5 years ago.

so you can't answer a basic question, lol
what does it mean for FP code to be formal and correct
i'm looking for a rigorous answer here

Computers are lost. We need to start over.

Attached: 1560827377062.png (1200x1200, 745K)

even more specific than that: it was about having a typed lazy functional language that could be run on normal hardware:
microsoft.com/en-us/research/wp-content/uploads/1992/04/spineless-tagless-gmachine.pdf

>Haskell is useful
it's not
>inb4 but IO is really impure

Are you a faggot?

okay, you first user

Attached: 1529960661792.png (1000x600, 1.16M)

if by "basic question" you mean the question of a base person

Well, fuck you too.