/dpt/ - Daily Programming Thread

Old thread:

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

Attached: lisp.png (2880x1800, 562K)

Other urls found in this thread:

rosettacode.org/wiki/Y_combinator#Scheme
twitter.com/SFWRedditVideos

Please use an anime image next time.

Attached: 1566619996100.jpg (564x752, 46K)

lisp is anime

Anime isn't a list.

How can Lisp be anime if it's not zero overhead and has a GC?

Anime as data
Anime as code

lain uses common lisp

Why the fuck am I so slow at learning?

I graduated this May but have been unable to get a job because my I jerked off too much in Uni.

Attached: 1341707019714.png (513x453, 409K)

Are you implying anime is imperative?

I fucking hate anime

What does you're waifu think of that?

Attached: 1566378877161.jpg (886x642, 119K)

>functional languages

Attached: 1481937588237.png (312x346, 217K)

I have no Waifu.
I have Husbando.

I scraped a scientific database which has no reasonable API and is only accessible through a horrid Web search interface mired in a horrific mess of nested tables
s,  s, inline stylings and many, many nested and tags. Parsing that took half my day. At the deepest it was 46 tags deep. Just to present a simple table of results.

Now I'm setting up a proper REST interface for a private mirror.

based

Attached: darjeeling.jpg (1024x576, 67K)

SAME

Attached: 1552175511970.jpg (310x300, 46K)

what database?

potato physiological phenomics database

>tfw /dpt/.txt twittered your post
pretty gay desu senpai

>t.

Attached: 9B0B70A2-C98A-40B1-B985-4F63BB7805C7.jpg (739x415, 31K)

what post?
you should be ashamed of yourself

Declaring an exponentiation function in C:

int exponent(int base, int exp)
{
int pow = base;
int v = 1;
if (exp < 0) {
assert (base != 0); /* divide by zero */
return (base*base != 1)? 0: (exp&1)? base : 1; /* 1 case */
}

while(exp > 0 )
{
if (exp & 1) v *= pow;
pow *= pow;
exp >>= 1; /* divide by 2 */
}
return v;
}

Defining an exponentiation procedure in Scheme:

(define (exponent b n)
(if (= n 0)
1
(* b (exponent b (- n 1)))))

Attached: 1566915960223.png (1280x720, 721K)

it's not my fault I get #metoo'd on a taiwanese basket weaving board

what

in lisp, this is just expt

You can also assert in Scheme. Don’t be a trimming faggot

>inb4 pythonfag wraps ** in a function

>inb4 lispfag wraps expt in a read macro

>compile former
>under 1kb
>compile latter
>15kb

))))))))

It's already been written in a previous post.

what post

>under 1kb
More like 8kb with gcc/glibc

what programming languages can numb the pain of having to experience life on this awful plane of existence?

lisp + malbolge

Lisp is the only one that does that.
Drown out the roar with parentheses.

{
{
{
}
{
{
}
}
}
}

...

...

Should I learn (((clisp))) or scheme?

Clojure

Python is gay.

Attached: 1566113805400.jpg (1280x720, 157K)

common lisp using SBCL

common lisp using sbcl and emacs

you're gay

Attached: australia's got talent.webm (1280x720, 1.6M)

Those are all bad implementations, even babies should do fast power through squaring instead of looping through one by one, and a recursive C solution is decent too.

what language can I use to write a program that rewrites itself and also that rewrites the language as it goes?

unironically common lisp

Ok but it's still gay.

Attached: konata.jpg (210x240, 10K)

same person
nice propagando, lisp weenie

You're all trying to bait dpttxt arent you

Lisp can do that and also reach back through a tower of interpreters to change the semantics of the language in the past.

Attached: yuki_sicp.png (934x1000, 388K)

This "lisp" sounds powerful, please, tell me more.

no

Attached: fag.png (393x129, 10K)

lisp shills in full force
brace for the parentheses

Also the worst thing that broke all my parsing for a while until I realized the madness going on on the page:

Certain table rows would have part of the row header italicized (basically a comment). The way this was done was that a tag would be opened before this bit... and would close at the end of the row. All the other entries in the row which were NOT italicized had inline CSS to keep them non-italicized, and the tag was at the end of the row.

Absolute madness.

I'd love to get a look at the aspx code that goes into rendering that bloody page.

learn how to use parentheses

I see your ) and I raise you a ]. The super parenthesis.

PHP mofos

okay, enjoy
(set-macro-character #\[
(lambda (s c)
(declare (ignore c))
(read-delimited-list #\] s t)))

(set-macro-character #\]
(lambda (s c)
(declare (ignore s c))
(error "Unmatched right bracket")))

bitch

not curvy enough

fuck lisp
lisp is so slow lmao
lisp is a dead language, responsible for the death of AI research
lisp is trash, no good libraries, no nice development tools, have fun deploying your application with a binary of 60mb

What about〔〕?

okay

btw did you know reader macros are universal?
they can't be made local to a package
inconsistent bullshit btw

at that point you might as well invent "bracelang", where braces are interchangeable, but can only be used once in a branch, so you're forced to look up more and more obscure braces if you want your shitty nested code to nest any deeper.
{([〈《「」》〉])}

no.. no, guys.
The lisp super parenthesis closes ALL prior parenthesis with a single use. That's just what it does.

make your own readtable and use it when you want to

>ad-hoc solution

yes, that's what packages are.

You can't even write functions to a stream, even though supposedly, Lisp supports functional programming.

The list
(lambda (x) (+ x 1))
Is not a function, but just a list of symbols and list, and if you read this form as if with READ, you will get a list, not a function.

>functional programming btw

What the hell do streams have to do with functional programming?

u r rely dum

CLOS is supposedly the best object orientation system ever, but it won't even conform like standard functions in Common Lisp
for example, there is no equivalent to flet or labels for methods in Common Lisp

Lisp Hate Thread btw

I finished my Character Generator! Or at the very least, I currently have it in a spot where I'm comfortable enough with it.
On to Conway's Game of Life!

you need to use eval in conjunction with read.

Because if they really are first-class, they should be supported in other avenues, like READ and WRITE

This is like having a number type, but not allowing it to be read or written.

>needing eval
hahahahhahahahahah
this is the mark of bad lisp style though
I'm sure you know

CCL on MacOS with Cocoa bridge.

>ad-hominem
this is the level lisp weenies are at btw

>believing read will do anything but read

Brackets are just parentheses with better posture.

except it wont read a function in

it will read the list, unevaluated.

that's my point
it should read in a function somehow
suggestion
#f(lambda (x) (+ x 1))

there, not I can easily read and write functions
for recursive ones, use y-combinator or something

stop pretending to be dumb and pretending that eval doesn't exist.

no need, there is #.

also y do you need to read printed lambda expressions for anything? you don't need read or eval to make a ycombinator
rosettacode.org/wiki/Y_combinator#Scheme

yeah, and how do you write a function to a stream then????
#. is just an eval reader macro

>Declaring an exponentiation function in C:
uh actually in C this is just
int exponent(int base, int exp);
and declaration done.

there are plenty of write functions that allow you to specify streams.

part of why I liked lisp is because of the freedom you had
not allowing me this is not freedom

I'm building a DAW, check out by sweet logo.

Attached: lambdaw_logo.gif (1687x897, 24K)

yeah but you can't write functions themselves
if you do they are in unreadable object notation

Nice

Because lisp provides better way to do whatever it is you want to do, lisp is bad? Christ dude is this really the best way you have to spend your afternoon?

but how am i supposed to make the logo if you do it for me?

Lisp doesn't provide a way to read and write functions like it does numbers, symbols, etc.
What are you talking about?