/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 14.png (1427x1360, 1.29M)

Other urls found in this thread:

github.com/promises-aplus/promises-spec/issues/94
youtube.com/watch?v=4jh94gowim0
package.elm-lang.org/packages/elm/core/latest/Task#andThen
package.elm-lang.org/packages/elm/core/latest/Task#sequence
package.elm-lang.org/packages/elm/core/latest/Task#map2
en.wikipedia.org/wiki/Common_Lisp_Object_System
twitter.com/SFWRedditVideos

Now, this is programming: github.com/promises-aplus/promises-spec/issues/94

nth for nim!

>smalltalk's image-based programming
>lisp's homoiconicity
>forth's speed
Why doesn't it exist? ;_;

>that absolute butt-hurt from the JS shitter

What's going on here, are they discussing changing the JS Promise API?

>Why doesn't it exist? ;_;

Because we are fallen creatures and we don't deserve good things.

Asking for blatant homework help here. I'm a bit of a beginner, using Java

If I'm using .nextDouble() to save user input in a double, how to I capture an exception and redirect the program if one is made? Like if the user puts in a string instead, instead of just showing the exception and halting the program, I want to re-prompt the user for input. I'm just not sure how to write "If exception, do this"

They were, back in 2013.

I particularly like the accusations of trolling and the claim that he actually really likes type theory, honest.

More importantly, why the fuck in Brian Mckenna even bothering with the brainlet JS community when webdev in haskell + elm is viable?

Lisp is the most powerful programming language.

>a reasonable suggestion is to write a flatMap and point function which just has a massive switch in the body that handles all real monads and all toy monads.
holy hell

>Lisp is the most powerful dynamic programming language.

this is more believable

it's pretty much like Scala all over again.

JavaScript rocks!

Attached: javascript rocks.png (1000x494, 134K)

>elm
come join the grownups in purescript!

Maybe try wrapping your code in loop with a try/catch block inside. Have the catch block catch the exception, and print out to the user that their entry is invalid, then continue the loop.

let me know when Purescript can enforce totality.

Which non-dynamic language is more powerful then?
False. Smalltalk is more powerful.

let me know when Elm allows as much abstraction as PureScript.

Sounds like a terrible place to work. How can you be expected to improve your own value if you can't get feedback?
I'd start looking for greener pastures.

What can Purescript do that it can't in terms of abstraction?
And what else do you want beyond alias'd types?

I can guarantee nobody on this board has ever completed SICP, they'll buy the fucking book so they can take cute pics of their fumos reading it, but they've never read more than 3 pages.

Attached: satania sicp.png (1280x720, 625K)

I don't think Scala ever got this bad.

If you had ever held a job you'd know that work is a competition and everyone around you is the enemy, with the manager being worst of all. You would also know that performance is pointless and politics rules all. Further you would know that there is 0 competition at uni.
But you can't know that, since you're just a fat basement dwelling NEET highschool dropout.

>Which non-dynamic language is more powerful then?

Powerful is a ill defined concept. I blame the Cniles for the introduction of the term in relation to programming languages.
Even C is more powerful if you want a program that runs faster. It all depends on the application.

I don't think the JS community has made someone rage quit as hard as paul phillips, making one of my favorite talks to date in the process.
youtube.com/watch?v=4jh94gowim0

>I think there's value to be had, but Promises/A+ is at best a single kind of monad
What does this even mean?

(You)

"Power" is not an order relation.

So allocating every little thing in C is less performant than a good GC but I can optimize the hot path to use faster allocation schemes like pools or arenas?

Is it normal that a bug chunk of my work consists out of searching on Google?

Has the JS community ever had anyone as good relative to JS as Paul is relative to Scala, though? If Scala has a score of -2 and Paul has a score of 14 then that's a difference of 16. If JS has a score of -7 then its community needs someone with a score of at least 9 in order for one of them to ragequit JS as hard as Paul did Scala.

That is one hell of a talk, I'll give you that.

No. Use a different search engine.

(You)

Last I checked, doing something like

Promise.all([fetch('a'), fetch('b')])
.then([a, b] =>
fetch(a.data)
.then(c => [a, b, c])))


would have been extremely painful

But it's something I need constantly

Dis' be true

Yes, but you can also do the same with competent GC's.

>being THIS angry
I work in a research lab. It's absolutely nothing like that.
What industry do you work in?
It sounds like one of those crusty old places that hasn't figured out Agile yet.
First of all, you don't work for the company, you work for your manager.
And it sounds like your manager is one of those top-college newfags with everything to prove.
Your manager should have nothing to do with the projects that you work on.
Maybe they should be familiar with the field and the people in the company who work on those projects, but that's the limit.
The project leader who delivers deadlines and sets expectations needs to be someone who is actually on the team and programming by your side. This way they can actually set realistic deadlines and expectations.

It sounds like you just work in a really terrible environment.
Change jobs quickly, you're getting stockholmed.

Attached: i4oYqFy.jpg (600x446, 110K)

Don't think so, you know a language is shit when you can't even think of a prominent person in the community. That NPM slag on rust-core comes to mind first before anyone else, which is sad.

t. never held a job

t. conditioned into thinking his terrible situation is normal for everyone
true wage slave right here

Not really, that's just a map and pipe if you take away the promise wank.

why is this True? I'm bad at math.

from math import pi


def find_area(r):
a = (4 * pi) * (r**2)
return a


print(find_area(0.5) == pi)

I feel bad for you. Nobody at work is my enemy and everybody in the shop respects integrity as a person, being nice, and technical excellence, more than politics. My manager is awesome and definitely looks out for me.

>reddit spacing

Both jobs I had were in relatively small companies (100-200 people), so I guess I got lucky. Enterprise must be hell.

1/2 * 1/2 = 1/4
4*pi*1/4 = pi

umotm8. (not him)
reddit spacing is double-newlining, you can't double newline a single-line post, you mong.

It's not wank, it's basic async I/O. Yet in Elm it was horribly complex last time I checked, since you can only return one Cmd as the result of an event so you need to do Task trickery and I don't think it still can do the same without having to use aux events.

If Elm can do the equivalent, please post a sample.

What about Douglas Crockford? I'm not familiar with his work but his name seems to come up a lot in relation to JS.

4 * x * (0.5^2) = 4 * x * 0.25 = x

Just because the OP is from gabdrop it doesn't mean you're allowed to leave your apple shitposting containment thread, satania.

Attached: 1492870106236.jpg (612x816, 211K)

smalltalk using images is one of the main reasons of its demise.

# 0.5 = 1/2
# 0.5**2 = 1/4
find_area(0,5) = (4*pi)*(1/4) = pi

based and redpilled
cringe and bluepilled

Because people are retarded and can't deal with superior technology?

>Smalltalk is more powerful.
>enforces oop at every level

sure

Attached: wow anon.jpg (884x574, 78K)

God, fuck CMAKE and fuck makefiles and fuck CUDA. Fuck computer science, fuck everything.

package.elm-lang.org/packages/elm/core/latest/Task#andThen
package.elm-lang.org/packages/elm/core/latest/Task#sequence
package.elm-lang.org/packages/elm/core/latest/Task#map2
You should probably stop talking about a language you know fuck all about.

>t. brainlet

After many hours you'll make it work. But you won't be able to repeat those steps on another computer, and the agony starts again. Enjoy.

Finished my flashcard game in Haskell. It's really simple, but should do the job.
Now it's time to start generating some decks.

use a language with a package manager.

Go ahead and post the code then, shouldn't be that hard since it's just 4 lines of JS.

Weirdly enough, I unsarcastically dig toxic, competitive environments full of crunches, politics and other shit.

The whole respect & helpful shtick bores me for some reason.

This may (hard may) be true if you work as consultant, but most people work in team.
If you fuck up or dont do a task , somebody have to do it.

That why people are friendly and helping each other. (Not leech)

There is a difference between a respectful and helpful environment and a coddling environment.

It's real OOP instead of OOPs, I fucked everything-OOP. For example, classes themselves are objects, and you can send messages to them, such as asking how many instances of a class there is using an instance of that class:
someInstance class count.

You can do arbitrary operations dynamically that way:
someInstance class subclass: #subclassOfTheClassOfSubInstance ...

It can also dynamically modify any part of the running image, which is slightly more limited in e.g. common lisp (and extremely limited in scheme implementations).
But more importantly, you can dump the image in a portable way and share it, you can merge images from various people, you can take individual objects (remember: almost everything is an object, so you can basically take any construct of any kind) and share the changes you made to it from some common base in isolation. This is something lisp can't even remotely do.
The tools are also really cool in that you can do things like edit the image such that the IDE that comes with your smalltalk is a project-specific IDE with controls to change parts of your image's running objects. Think for example for 3d graphics. In CL you can replace a model currently being rendered in the running image in code and have live updates. With smalltalk, you can have controls in the IDE allowing you to click a button, choose a file through a GUI, and have that loaded into the image. This includes very significant features like being able to choose a color with a color picker or using sliders, allowing you to manually roll over possible values to see the change in realtime.

What language with a GC lets you write an arena allocator? I was under the impression that pools were as good as it got.

>no true oop

You wouldn't return a list of Tasks, nor do you need to, so i don't exactly get the point. If you have another example that isn't retarded, i'll translate it.

You've probably never experienced something like that.

There are a few true OOP. CLOS is nice. Smalltalk way is better still. C++/Java/Python's is a joke.

smalltalk doesn't even have multiple inheritance. CLOS is much more powerful and you are not forced to use it everywhere.

en.wikipedia.org/wiki/Common_Lisp_Object_System

It is literally in my job description to help out junior devs get up to speed. If they fail, I fail.

I think it's plausible that he's experienced an environment where other people put up with his shitty attitude instead of calling him out on it.

OpenDylan uses an arena allocator GC by default. Many languages let you enable or disable the GC at will and do manual management at any point in the GC-free segment, allowing you to implement arbitrary schemes. ATS is an example.

You can do Tl;dr next time
I gave up half way

I mean why not? Imagine a and b are http requests, so we perform them simultaneously, and the third request needs data from possibly both a and b. We then perform the third request and combine it with the earlier results, so that we get a list of everything we need.

I'm not proficient with Elm and a bit tired so I don't feel like trying to type it out, but it does sound like the examples you posted should be enough to do it. I just wanna see the result for real.

So now that the dust has settled, tell me /dpt/ why programming GUI is always so fucking shit?

How do you do that? Do you force them to fit a boring company mold, never innovating, never thinking?

That's not how politics work, though. Instead of 'putting up' with him they'd turn him into effectively a janitor, deny him any access to a computer, and simultaneously blame him anytime anything computer related that's bad happens, causing him to never get even a normal bonus at end of year, let alone any raise.

Don't hire juniors -> problem solved.

It's not shit with virtualDOM libraries. Too bad desktops haven't really caught up with it.

>literally so inbred he can't read 3 sentences
>expects being catered to
kek

ATS is unbelievably badass. The syntax isn't great, though.

Wrong. They get fired and you get a raise for judging them to be useless thus protecting the company interests, even though they have done everything expected from them and then some. But management doesn't know that, you claimed credit for everything while you were on facebook all day after all.

Not everybody has the energy or inclination to do that. Some just tune out the offender. Sometimes the offender is a higher-up's 'golden child'.

So, instead of
>Your code is shit
You want to get
>Your code is shit, the project manager has been notified about that, so he'll be reviewing your salary in the next meeting. Also, I told our janitor it was you who spilled the soda in the corridor.

Agreed. It's too bad the syntax is so bad it will never be usable at this rate.>Sometimes the offender is a higher-up's 'golden child'.
That's exactly the only time when people don't politic the shit out of those people, because if they do, they're the ones who are going to be politic'd.

Not enough senior dev.
That why we have something called bootcamp and good pay

Maybe he's into that.

Task.perform sequence ta tb tc

That has nothing to do with oop though.

MOAR LEDS

Attached: moarleds.webm (1280x720, 2.42M)

Attached: 1546638416653.jpg (1152x720, 83K)

Hire Haskell devs instead and let them use it. You need fewer of them. No more need to complain about a "talent shortage".

How does everything being an object "has nothing to do with oop"? How does everything being the same construct (an object), thus allowing versioning and sharing anything in arbitrary details, unrelated to OOP?

looks fun
at 0:04 it looked like it was winding up for a jump

Not equivalent at all, that's just the first Promise.all(...), but c should depend on the result of both a and b