/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Sup Forums?

Other urls found in this thread:

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
youtube.com/watch?v=3U3lV5VPmOU
ieeexplore.ieee.org/document/677186/?reload=true&arnumber=677186
twitter.com/SFWRedditVideos

stop hating node.js

a re-design of Rust's BC in my language that will never be because im a lazy shitter

Learn a real language you fucking mongoloid.

In what way is JavaScript not a real language?

>dynamic typing
trash language

Why? I bet you can't even tell me why dynamic typing is bad without resorting to memes.

>everything I don't agree with is a meme

it should be readily obvious to any competent programer

I find it harder to read ;_;

Not him but, FooNaN
Plus even before i knew the difference i was autistic about wanting to know what types my variables were.

I want to start an RPG in C. I've already got the movement system and most of the RNG figured out. I'm struggling on the input, menus and pretty much any algorithm that doesn't return a single value.

literally zero arguments
gg

That's not what he said, dumbass.

>Plus even before i knew the difference i was autistic about wanting to know what types my variables were.
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

You can either use structs or pointers to return multiple arguments from a function. Menus will suck, but look at GTK+, depending on inputs GTK might help you there too.

>FooNaN
What?

am I being baited or is this really the mindset of the javascript developer?

Not an argument.

>it's another /dpt/ hates something for no reason except rampant elitism episode
fucks sake

>have to call typeof every other line to make sure my int didnt become a char array

wew

Dfags, how should I make this more efficient?
///A personal library for permutations, combinations and distributors
module lib.combiners;

///[1,2,3].distribute([-2,0]) == [ [1,-2], [1, 0], [2,-2], [2, 0], [3,-2], [3, 0] ]
auto distribute(T)(lazy T[] arr1, lazy T[] arr2) if (is(typeof(arr1) == typeof(arr2)))
{
T[][] result;
result.reserve(arr1.length);

for (ulong ri, e1i = 0; e1i < arr1.length; e1i++, ri++)
{
result ~= arr1[e1i] ~ arr2;
}
return result;
}

///[1, 2, 3].distribute(["a", "b"])
///=> [(1, ["a", "b"]), (2, ["a", "b"]), (3, ["a", "b"])]
auto distribute(T, U)(T[] arr1, U[] arr2) if (!is(typeof(arr1) == typeof(arr2)))
{
import std.typecons;

Tuple!(T, U[])[] result;
result.reserve(arr1.length);

for (ulong ri, e1i = 0; e1i < arr1.length; e1i++, ri++)
{
result ~= tuple(arr1[e1i], arr2);
}
return result;
}

I'm working on a JS interpreter. The language is... challenging. For example, what does this function do?

function foo(x) {
var z = x+1;
}


If you said "nothing", you're wrong.

people who aren't retards and know what they're doing don't have that problem

Is it supposed to have graphics? Use SDL then. It's super easy and it's what Valve uses. GTK's overkill.

javascript is literally shit, even in a web browser your website should still work with javascript disabled, and if you're using javascript for desktop applications then may god have mercy on your soul

>even in a web browser your website should still work with javascript disabled
Why?
>and if you're using javascript for desktop applications then may god have mercy on your soul
Still no arguments then?

>if you're using javascript for desktop applications then may god have mercy on your soul

I don't know guy, seems like Electron is going to take over the future of software development.

w-what does it do?

And i also dont have that problem and dont have to worry about ambiguity either.
Dynamic tying makes for lazy and incompetent programmers.

And god help any web artisan that attempts to learn an actual FPL with dependent types

weak bait

>being this delusional

Thanks for using an apustaja image.

I'm running noscript, so nothing

>Dynamic tying makes for lazy and incompetent programmers.
This makes literally zero sense. Do you even think before you type?

>>even in a web browser your website should still work with javascript disabled
>Why?

Not him but this is why.

weak bait

name one javascript programmer who isn't lazy and incompetent

It can run arbitrary code when x is an object with an overridden number converter.

And how is that bad, exactly?

jesus christ

Ah yes, because your average JShit dev is the model programmer.

Do you want to try to refute or give any valid application of DT besides the wrong kind of """"convenience""""

Are we mad at javascript because js code artisans make way more money than us writing business logic

youtube.com/watch?v=3U3lV5VPmOU

oh no I guess those web artisans will have to skip hipster haskell and go straight to lisp then.

>Do you want to try to refute or give any valid application of DT besides the wrong kind of """"convenience""""
How is it the wrong kind?

They don't though

LOL

dumb frogposter

No we hate JS because its single-handedly set back the web, decades.
>cant even tell me yourself
Because DT generates shitty and unmaintainable code. Thats why the web is a house of cards built on a foundation of incompetence and bloat.

JS code artisans work for startups that pay low salaries and worthless equity or options

I don't know why I still come to these threads.

because of Haskell!

implying js ruined the web, not social networks and adverts

they're mostly self-taught hobbyist brainlets, and the few bay area queers that make any money have terrible job security at webfag startup companies

JavaScript was my first language.
Or python.

I have a tendency to learn two languages simultaneously. I hate python more than JS because python syntax is kinda less ntuitive. Same goes with JS but at least JS is not white space sensitive

>Because DT generates shitty and unmaintainable code.
How? I'd like to know what leads you to believe that.

years of experience with both dynamically typed and statically typed codebases

Wait, are you talking about dynamic typing? I thought DT stood for dependent types

you don't actually believe this shit do you?

(both)
>#TRIGGERED

Okay, so you don't have an argument. Just anecdotes and ad hominem. I just wanted to confirm. Thank you.

>come join our startup!
>our stack is node and ruby
>we can't pay you a great salary but we can give you options and pizza
>btw you'll be expected to put in 12 hour days regularly

no i'm sure your artisan video game company will be a huge success

Youve never had to work on a JShit code-base in depth if you really have to ask that.
There is literally no valid argument for your language being dynamic besides laziness. It only serves nothing but issues.
dynamic typing lad, thought that was clear.

You're a good driver, user

>dynamic typing lad, thought that was clear.
I didn't bother reading the rest of the thread

ieeexplore.ieee.org/document/677186/?reload=true&arnumber=677186
enjoy

...

fuck off with your IP grabber

who needs types when you have tests?

Wasting resources.

>inb4 but what's that for modern computers

Scale it to every site on the whole of internet wasting your resources and you've got a 1% larger electricity bill.

Or a 40% larger internet bill if you're on a data plan.

Scale that through a year and you're working somewhere near a whole week just to pay for someone's decision to bloat up their website.

Youve still never given me an argument for what makes DT good besideos a youtube link i shant be watching.

>Scale it to every site on the whole of internet wasting your resources and you've got a 1% larger electricity bill.
bullshit

>he isn't behind 7 proxies

Dynamic typing is just static typing done at runtime.

>Youve still never given me an argument for what makes DT good
It's pretty self-explanatory.

Then humor me.

fuck off to

>muh c and haskell safespace

Tests should only be reassurance, not a requirement for functioning code.

...

>programming thread
>except for programming languages i dont like
not your safe space, pal

Not him but do you not see it streaming 256KB+ a second? That's more than a fucking mmo uses.

Do you not see it using 100mb of memory? That's also more than many video games.

The Internet would be SO FAST if web monkeys weren't so wasteful. Instead of being able to do more with faster computers, we end up being able to do the same because the monkeys who program websites expand how much resources they use. It's a shitty fucking Parkinson's law.

>>>/tumblr/

dependent typing > static typing > dynamic typing > dependent typing

100mb memory... wow... literally an average google chrome tab... amazing...

this thread is so bad

you don't even like javascript

you're just trolling

>That's also more than many video games.
hell no

Well, I think this is the last time I'll be opening a /dpt/ thread. Even Reddit is better than this.

he's right you know

>All of these meta-fags
Fuck off. You're not increasing the quality of the thread.

>i only play bloated ubishill games and shit that kids hacked together in jewnity engine just to exploit the steam trading card system

metaprogramming is fine

>chooses a tiny indie game that nobody but Sup Forums cares about to prove his point
lmao

>garbage indie game

huh

>CNN
Fuck off.

>and if you're using javascript for desktop applications then may god have mercy on your soul
Why? Is it because it's easy to use? Where is YOUR fork of VS code?

Enjoying the nice weather in California, Patrick?