/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

en.wikipedia.org/wiki/List_of_JVM_languages
lights-of-holiness.eu/android/
benchmarksgame.alioth.debian.org/u64q/pidigits.html
pgloader.io/
tapoueh.org/blog/2014/05/why-is-pgloader-so-much-faster/
pastebin.com/p6RW16sN
u.sicp.me/jVbYU.png
myredditvideos.com/
twitter.com/SFWRedditVideos

HAMT implementation, just for educational purposes.

Reimplementing Scala in JS

java is good

prove me wrong

today's my comfy day so I'll just be shitposting on Sup Forums while playing weeb tunes and games

en.wikipedia.org/wiki/List_of_JVM_languages

write a function that swaps two ints

Daily reminder that in the future, programming will be just a drag and drop task, and you all will be jobless

universal income will exist by then and NEETs will take over

Daily reminder that in the future, work will be obsolete and people will instead pursue more creative endeavors

Someone still has to make, maintain, and update the dragon drop

gib me idea for mobile application.

that is done with another drag and drop application.

it is drag and drop all the way down

Too bad that, necessarily, not all programs will be constructible like this.

The only ones that need to be worried are code monkeys.

ILOAD_1
ILOAD_2
SWAP
ISTORE_1
ISTORE_2

Officially one year of working on my toy programming language! 10 kloc... I think it's time for this codebase to go on a diet.

But someone still has to do those things to the first one.
Programmers will never not have jobs until robots become sentient and self-sufficient. But by then you should probably find another galaxy to live in.

post hello world

are you implementing the normal one or the functional version?

Functional, in CL.

It's a very neat data structure. I discovered it very recently, as I was reading up on the data structures that Clojure uses. Surprised to see how widespread it has become.

>Implying scratch is not a programming language with drag and drop creation tool
inb4:
>Implying scratch is not a turing complete language that can do any other language can

scratch is shit
blueprints are shit.
dragon drop programming is inherently shit.

Sure, it is Turing complete.

But, then why does it being drag and drop make it simpler to use, over, say, Python or Ruby?

Not really. You could self-host the "drag and drop". I don't believe the technology will simply be drag and drop, however; doing this essentially requires robots to understand people language. Jeff Dean does seem alarmingly confident that we'll solve linguistic comprehension in the near future, though...

Yes, and the possibility that it will make all programmers magically obsolete is fucking stupid.

Pick your sepplefu

scott meyers a best

Not really. But, do yourself a favor by ask any brainlet around you. Which one they prefer:
>An interactive view, with on their face explanation of what something does, and how to use it
>Consult to a documentation with more than 5000 words wall of text to know the function of something and how to use it

Ok everybody, you can stop making mobile applications with your meme languages now!
Common Lisp has bindings to QT5 and can deploy to any platform.
lights-of-holiness.eu/android/

>Common Lisp has bindings to QT5 and can deploy to any platform.
Including an entire CL runtime with your mobile app sounds like a dumb idea. This is coming from a CL programmer.

Oh boy, can't wait for my games to run at the speed of C++mmon lisp.

Is the CL runtime really that heavyweight? There's gotta be a lightweight one.
>For this reason, all apps are ca. 15 MB big
Holy fuck.

Only to people who aren't knowledgable about programming.
Ok so then people start using this application. People who are experts at using it have it as their job, just like with Word or Excel. It's more efficient to switch to the text-based interface from the drop and drop one. Now it's just regular programming again.
I just don't think it's an issue until computers can turn plain english into machine code. Then programmers will be totally obsolete.

>can't wait for my games to run at the speed of C++mmon lisp.
>my games
Why don't you show us some of your intricate and resource-demanding, user?

It uses ECL which runtime is native library which is pretty small. The bigger problem really is the QT libraries that you also have to deploy.
The site says the applications are about 15mb.
If you use python with kivy the application size might be around 100mb.
I have used javafx with javafxports and the apk started at 8mb.
so 15mb isn't that bad. At least it's not web app.

I HATE DEVELOPING ON WINDOWS

The second you show me a fast Lisp program beyond a hello world.

>15 MB overhead
That's nothing for a desktop app, but kinda bad for a mobile one, and very bad for an android app.

:^)

The size comes mostly from qt5.
If the whole thing used native calls or opengl it would be around the size of lambdanative applications which start from 2-3mb because of the runtime.

benchmarksgame.alioth.debian.org/u64q/pidigits.html

The fastest common lisp program is faster than the fastest C++ program on this benchmark.

Isn't your backend C?

>slower than Ada, Rust, Swift & C

>backpedaling so fast
But I wasn't making any claims about my Lisp programs. You're the one who's talking about "his games".

yes. but now brainlet even able to do basic programming, and unless you are top of the class programmer, you gonna be replaced easily

>posting bait website

Chapel confirmed for fastest language!

pgloader.io/
>Why did pgloader get so much faster?
tapoueh.org/blog/2014/05/why-is-pgloader-so-much-faster/

Use a computer then

desu, i won't touch anything that's not vulkan-compatible.

Brainlets can do basic programming now. Just look at my class... graduating in the spring and barely any of them are competent.

>vulkan-compatible.
>implying
You're not going to make anything worth it, so what's the point?

The renderer thread is C, but the game logic thread is almost entirely Scheme. The only C in the logic thread is to push renderer commands to the renderer queue.

>vulkan

>thinking it's about the knowledge and not the connections

lmao

But user, common lisp is a meme language

dumb plub poster

>almost entirely
>not entirely

dropped

>vulkan is bad despite games getting an instant 20-50 frames performance boost
wew lad

>wew lad

No, I know. It sucks. I wish the world was like how my freshman self had imagined it (if you really love software and try hard, you will succeed). It's a lot more about connections, unfortunately. I've been buying fashionable clothes and working on my social skills in order to get by at the workplace.

Exactly. Call me when it's entirely Scheme.

>eww i don't want my games to run slow like CL
>"show us your games"
>no! your games are slow!
>muh vulkan!
>rust!
>webdevs!
>haskell!
>let's not talk about my games, okay?

write a fizzbuzz in x86 assembly
first one to do it gets 6 buttcoins

Reminder that OOP is at its core literally nothing but the concept of being able to overload a function on the runtime types of at least one of its parameters, and message-passing is invariably an implementation of this concept, regardless of how the message-passing itself is implemented

show coins

Not even C is entirely C you baka. If you demand 100% of a language, you're going to only get assembly.

How can I learn data structures, preferably in Python. I tried to look and everyone just says to sign up for leetcode or hacker rank, but I don't really know how to do even the most basic questions. I did okay with Codingbat, but when it starts getting mathematical, I feel like it's all chinese. Any tips?

>show me a game that runs fast in CL!
>o-okay, but it's 1% C so it doesn't count!
Retard.

>games getting an instant 20-50 frames performance boost on a (very) restricted set of platforms with an API that makes D3D look concise

...

section .data
fizz db "Fizz",0x0a,0
buzz db "Buzz",0x0a,0
fzbz db "FizzBuzz",0x0a,0
fmtnm db "%li",0x0a,0
section .text
global main
extern printf
main:
push rbp
mov rbp, rsp
mov r13, 1

loopj:
xor edx, edx
mov rax, r13
mov r12, 5
idiv r12
mov r14, rdx

xor edx, edx
mov rax, r13
mov r12, 3
idiv r12

xor eax, eax
cmp rdx, 0
jnz buzzj
fizzj:
cmp r14, 0
jz bothj
lea rdi, [fizz]
call printf
jmp donej
buzzj:
cmp r14, 0
jnz neinj
lea rdi, [buzz]
call printf
jmp donej
bothj:
lea rdi, [fzbz]
call printf
jmp donej
neinj:
lea rdi, [fmtnm]
mov rsi, r13
call printf
donej:
inc r13
cmp r13, 101
jne loopj
leave
ret

You got completely destroyed here:

>a (very) restricted set of platforms
[citation needed]

Assembly isn't even entirely assembly though. Far from it: literally none of it is implemented in assembly. In fact it's not even implemented in a language you can write in symbols. The only way you can write in the programming language that implements assembly is with silicon and copper as your ink.

java is probably the worst widely known jvm language, literally wasted 10 years making 0 progress on anything and now they're vaguely starting to do shit but it's way too late and they'll never catch up at the rate they're fixing shit

The real world proves. Vulkan doesn't even run on most GPUs.

What are "most' GPU's?

How do you expect to tell the GPU exactly what to do and no more without a lower level API? You can use functions to reduce any duplication, you know.

>games getting an instant 20-50 frames performance boost
vulkan is complex and not easy to use. you cant just replace opengl/directx with vulkan and expect an instant performance boost. thats not how this works.

Rate my function.
pastebin.com/p6RW16sN

Except that I'm not failing to understand what he's calling "OOP," I'm refusing to understand it, because it's not OOP, just a shitty implementation of OOP.

Message passing, encapsulation, etc are all ways you can do OOP. They are not OOP itself. For example, a message is a function overloaded on the runtime type of one of its parameters (to which, incidentally, it's considered to belong). This is not merely a possible implementation of a message, it's fundamentally what a message is, and any implementation of message passing adheres to this definition, even one that doesn't use functions in the language's native sense of the term.

Also, of course this definition of OOP has no useful properties. It shouldn't; it's the lowest common denominator of every concept that claims to be OOP. It's not itself a useful implementation of OOP because it's OOP itself instead.

>AMD 1440
>Average frame rates are up by 20-30 percent on everything, this time including the R9 285 2GB. Minimum frame rates show similar and even slightly higher improvements, ranging from 15-35 percent.

Vulkan is a dream for AMD cards. Nvidia a little less so, especially the lower-end cards. If anything Vulkan will extend the life of AMD even farther.

>Vulkan will extend the life of AMD even
Now if only AMD made properly working drivers.

Yeah, we are all omnipotent and we knew what Member is

2009 wants their le epic maymays back.

>of course this definition of OOP has no useful properties
So your "rebuttal" is to confirm what he said? Bravo. If your definition of OOP has no useful properties, and it simply constrains multimethods for no reason, why should anyone care about your definition of OOP?

I need some fun projects to work on, would be cool if they had some kind of visual output.

I haven't programmed anything in ages.

>Imagine a GPU vendor that STILL doesn't support most of OpenGL4 extensions

my bad
typedef struct member {
char* name;
int hp;
int def;
int att;
int spells[3];
} Member;

>Rate my function.
It's as bad as your image-loading library.

OGL is on its way out so it doesn't matter

>If your definition of OOP has no useful properties, and it simply constrains multimethods for no reason,
Not no reason, but merely because excluding them is not useful unless you're talking about encapsulation and message passing, and it's simpler and more general to include them.
>why should anyone care about your definition of OOP?
They shouldn't, because no one should just do OOP. People should do the kind of OOP suited to the task at hand. But not caring about a definition doesn't entail not recognizing it. For example, "thing" is a word whose commonly accepted definition is very general and has no useful properties, and no one really cares about it, and yet no one would deny that a potted plant and a shoe are both things.

>OGL is on its way out

Starting Love2D and Lua.

u.sicp.me/jVbYU.png

on its way out in software means a few decades at the very least.

>char* p = malloc(5);
>proceeds to leak it
Just use a fucking normal array.
>Reading over the file twice
>Single letter variable names that are not obvious at all from context
>Not using fgets or something
2/10

Reminder that a monad is a monoid in the category of endofunctors.

Reminder that a monad is a monoid in the endogory of catefunctors.

Reminder that a moan ad is a monodiddle in the eroguro of cat-fuckers.

union Array[n: Uint, T: Type] {
nil: 1,
cons: struct {
head: T,
tail: Array[n - 1, T]
}
}

Forgot the most important part.
union Array[n: Uint, T: Type] {
nil: 1 | n == 0,
cons: struct {
head: T,
tail: Array[n - 1, T]
}
}