/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1541591286787.jpg (1280x720, 356K)

Other urls found in this thread:

ai.stackexchange.com/questions/2236/why-is-lisp-such-a-good-language-for-ai
twitter.com/SFWRedditVideos

Lisp is a reasonably strong programming language.

Attached: 1562795884627.jpg (456x578, 58K)

first for death to all cniles

Attached: 1558348540150.jpg (706x1000, 252K)

Clojure is a joy to work with so far how come there aren't more people using it??

You're so good at this, Anone! I see you learned a lot of JavaScript so far!

Attached: 9f2622810caf07a1a1fbd42568df7722.jpg (1067x1600, 262K)

java was a mistake, how do I get a real job

Is it really? What does it have over CL?

>typlets
yikes

A program which controls a gun designed to shoot me in the foot.

Ease of deployment thanks to the JVM.
The JVM makes it so you are way more versatile while still staying lispy.
It somewhat also enforces you to be functional most of the time which is good for concurrency systems and it lets you bypass OOP.
It also has more built-in datatypes and you don't have to do gay shit just to be able to toy with hash tables.

It's just way too fun.

Given an array with n integers, check if it could become non-decreasing by modifying at most 1 element.

We define an array is non-decreasing if array[i]

>let, const
>arrow functions
>array/object restructuring
>map, filter, reduce, flatMap for arrays
>rest/spread syntax
>module system
>async/await
Is there a language with a better redemption story?

Attached: js.png (1200x1200, 27K)

isn't this just finding at most one local maximum?

It's been the standard for 25 years. What's there to redeem.

Why would I seethe? As long as you don't do it I keep winning, because unlike you I've seen the data.

If there's someone who should seethe it would be you, because you keep losing.

>literally just patching over holes that shouldn't exist in the first place
>a feature every other language has had since forever
>decent feature but not unique to JS
>decent feature but not unique to JS
>apply except retarded
>literally every language has this
>just retarded monads

Reminder that C is asm for $9/hr Pajeets

Attached: 6F6C0ABA-C907-4065-9512-275D7307D500.jpg (701x1024, 89K)

Ooooooh, someone's mad as hack.

Attached: the-javascript-trinity.jpg (659x317, 41K)

>C++ is asm for $9/hr Pajeets
ftfy

I know JS was developed in a weekend, but why are Christians too retarded to figure out transitivity after 2000 years?

Attached: 55E50B7D-9DB2-425E-B9CF-6CCE05C03172.png (562x389, 180K)

check = go True where
go _ [_] = True
go b (x : xs) | x

the contradiction of the negation of an existential is an existential, not a particular individual.

C++ is written in C, so by extension it applies to C as well.

>no data
>still winning

>user demands data
>user can't into logic

>user has seen data
>data confirms hypothesis
>ergo user 2's logic is flawed

¯\_(ツ)_/¯

Unless a transitive relationship can exist between 3 hypostases that share the same essence it would presumably break the unity of God.

Attached: 44749254_1937946093173510_7716148265853551237_n.jpg (1080x1080, 122K)

This is what happens when you let Ctards write software.

Attached: 1533433146668.png (532x119, 12K)

thanks for proving you can't even babby's first order logic
not that I expected differently from a cnile

is emacs worth learning for programming?

Attached: 1562761078467.jpg (750x669, 84K)

>literally not even trying anymore

>still no data
>still winning

¯\_(ツ)_/¯

>make shit language
>everyone thinks it's confusing and annoying
>associated with babies
>fix it by trying to copy functional languages
>babies follow suit
>async function (function (){() => {}}();) {}
>we did it guys we saved JavaScript

>web dev in C
did the website use fast cgi or something

I used to work with javascript for gaming, ESP with three.js for 3D and phaser.io for 2D and the biggest gripe (still) is/was the lack of:
A. A core/standard language design. I'm no expert on languages but having used multiple it just felt like JS was a tiny script combined with jquery and angular and at least a dozen other stuff to do what python can do without any imports (roughly speaking)
B. No deep/comprehensive ide for JS (or web dev , in general) as apposed to PyCharm or IntelliJ.)
What are your thoughts on my points, here? This language needs a complete makeover, IMO... OR maybe we need something different, fundamentally? Do let me know about your thoughts and this is also my first post on g! :)

Attached: 19fq7c002w021.png (1080x1087, 906K)

x elem {y : P(y)} => exists x. P(x)

It happens when you try to retrofit lisp into java syntax

Just use a transpiler from a better language to JS

>daily "shill your favorite programming language" thread edition n. 0081764

I reckon the "is" there is more like the inheritance "is" than the identity "is".

hey!!! I just looked into this. I triiied and I mean i triiied to do CLI coding with vim or emacs and let me sum it all up for you:
- If you can get all the plugins and settings set up smoothly and quickly go for it. You can probably have a very efficient coding station with waaay more features (or better done) than the best IDE out there.
- Buuuuuttttttttt if its taking you a while/you're struggling to get anything to a point where it's at least HALF as productive as coding in AT LEAST sublime text or so then you're doing yourself a big disservice. Not to sy you shouldn't try just don't make it your priority.

We just need to forget about it and pretend it never existed. It doesn't fill any purpose.

>let's pack a bloated language in the browser
nah JS is fine

I tried this working with the Godot Engine and the code it produced was incredibly inefficient. Of course this isn't /exactly/ a pure C++ to JS transpiler but I just don't think you'll get good results from this approach.

whats so special/good about lisp?

is this what happens alot in these threads? lol

well the problem is the transpiler then. I guess they don't optimize their code or give a shit about it as long it works

Web ASM should be a huge boon for the JS community then

>daily "shill a programming language you've never used" thread edition n. 0081764
ftfy

if you have a lisp, people might not understand you

The lack of syntax and how easy it is to express ideas

Nothing. Lisptards believe that quasiquoting is only possible if your syntax looks like (((this))).

Should be any day now.

Attached: Screenshot from 2019-07-11 16-11-40.png (644x114, 15K)

>quasiquoting
what did he mean by this?

1000 years in MS paint

Attached: 20190711_181406.jpg (750x668, 151K)

It's just so easy to endlessly bait people into arguing whichever programming language is less retarded since most of them are full of shit designs. Not to mention programming is pretty tiring for the brain, it makes sense this thread would be mostly used for funposting during mental recovery times.

>inb4 LIES! C++ STRONK

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

You have 30 seconds to write a prettier exponentiation function.

Attached: lab.jpg (438x750, 76K)

Is this recursive? Yuck.

Only in terms of syntax, it's tail recursive in implementation so would share the same stack frame like an iterative function would.

exponent b 0 = 1
exponent b (n + 1) = b * exponent b n

in python this is just
exponent = lambda b,n:b**n

)))))))))))))))))))))))))))):

The ** notation is kinda ugly tbqh

in haskell this is just exponent = (**)

New ones are made every day. It's just how the bell curve works. Some aren't C programmers by choice. They were pushed into it because of their high intelligence.

here you go then
exponent = lambda b,n:pow(b,n)

>wrapping pow in a lambda is technically writing a function so it counts
*golf clap*

It's a programmable programming language.

Also, executable code has the same form as data, so you can easily write code that generates/alters code. - very useful in AI.

Fair. I hadn't thought of that. I thought everyone were just warriors in here.
Lord knows I don't program enough to feel inclined to language war.

>Also, executable code has the same form as data, so you can easily write code that generates/alters code. - very useful in AI.
interesting

The most important thing when working on the long term project is to make code age well, make it modular, make it extensible, make it testable, make it readable even if it makes it slower, write a lot of tests and good documentation.

I'm learning it the hard way right now.

Attached: 15504935650870.jpg (418x486, 101K)

Now in O(log n) multiplications:
square n = n * n

exponent b 0 = 1
exponent b (2n + 1) = b * square (exponent b n)
exponent b (2n + 2) = square (b * exponent b n)

Im gonna read the SICP book and read that it uses Lisp(Scheme) so im probably gonna pick up lisp if the book gets me hyped enough. What are general uses of lisp, besides AI?

fucking everything

Lisp isn’t used much in modern AI because statistical models trash them in most real world problems.
The only practical use of Lisp is to learn Clojure and write CRUD for JVM systems without touching Java.

Do you have any more hot air you wanna share with us, or are you done now?

Here's an actual truth: writing proper code takes brains and effort. If you ain't got both, quit.

T. angry cnile

I'm trying to write a script in bash that prints out weather conditions for use in my i3status. However, the source material shifts back and forth on what its writing.

Last updated Jul 11, 2019 - 02:58 PM EDT / 2019.07.11 1858 UTC
Temperature: 75.0 F (23.9 C)
Relative Humidity: 87%
Wind: from the WSW (240 degrees) at 20 MPH (17 KT) gusting to 37 MPH (32 KT)
Weather: rain with thunder; mist; Cumulonimbus clouds, lightning observed
Sky conditions: overcast
Precipitation last hour: 0.06 inches

What I'm trying to do is make a hierarchy on what it should use. If the line "Weather:" exists I want it to use that. When that disappears I want it use "Sky conditions". I've tried using case statements and if elif but I can't seem to nail it down. What the is the proper way of doing this? I plan on repeating this for "Heat Index" "Wind Chill" and "Temperature" as well so I don't have to worry about shit shifting around on me.

I'm done now. Thanks for taking time to read my post.

I'm still waiting.
¯\_(ツ)_/¯

I love this Yui

read that book for the concepts, not just for lisp itself. they'll carry over to every language, you just won't learn any object-oriented stuff, but OOP is easy to pick up once you understand procedural and functional.

What would be the ideal syntax for this? So far I've come up with

exp(b, n) -> ((b * b) for n)

Attached: ren big think.png (714x847, 794K)

Simple but cute.
I'd marry her.

marry a cartoon?

Lisp honestly has fuck all to do with AI.

Well, could look like exponent b = fold 1 (b *) and could look like exponent b = fold 1 ((b *) . square) (square . (b *)), given standard folds for unary and binary natural number data types.

>Lisp honestly has fuck all to do with AI.
Do you think it has less to do with ai than any other language?

I have no idea, but just seems like a strange statement. It's like saying a hammer has fuck all to do with a house.

>what the fuck is wrong with python's import system
nothing. you're just a tard

what the fuck is wrong with python's import system? I want to use absolute imports to import things from files/directories above (in terms of directory structure) the current file, where the current file is a submodule of the greater project. I don't want to have to say shit like
from ....retard_project.submodule.specific_thing import cool_function
when I'd rather just say
from retard_project.submodule.specific_thing import cool_function
like every other language

You do: “ Import foo.bar.baz “ and baz is now in the namespace. You can append an “as blah” to alias the imported module as whatever.

>Lisp honestly has fuck all to do with AI.

ai.stackexchange.com/questions/2236/why-is-lisp-such-a-good-language-for-ai

Haskell can be pretty went it wants to but a lot of the stuff I've seen on gitbob makes it look messy with Int :: => x and sheit.

Attached: honor.jpg (852x461, 94K)

>Do you think it has less to do with ai than any other language?
Obviously any Turing-complete language is somewhat related to any topic in computation. That goes without saying.

Those reasons are all valid reasons to use Lisp, but not really relevant to AI in particular over anything else.

JS
const exponent = (a,b) => Math.pow(a,b)

Lisp is the most powerful programming language.

I can't believe I am asking this but here I go I guess.

I promised myself I would never learn Java but since I am learning Clojure I figured it would be kinda stupid not to learn Java at the same time. Any good ressource to learn Java in depth? Thanks.

Lisp hasn’t been relevant to ai since the 80s. It had all the thunder and dedicated hardware and still failed to produce sufficient results. Even prolog is more relevant in modern AI than Lisp.

do you even work in the field?

This is just a function wrapper my dude

Any language can be like my_exp(a, b) { return exp(a, b); }