/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

hastebin.com/itaninayuz.py
twitter.com/NSFWRedditVideo

Programming a gf

R8 my first python project
hastebin.com/itaninayuz.py

sends a notification if a new thread with a certain keyword is created

Haskell seems nice. Should I learn it?

Lads, is there a modern replacement for the dragon book?

maki's huge breasts!!!!!!

The future is uncertain. Please try again later.

Reminder to ignore statically typed garbage. Learn Ruby.

Learn Lisp.

I asked this last thread and got a meme response

Why is Ruby a joke here?

what book for learning C++?

Everything is a joke here.
Practical Common Lisp

If programming language means a language that compiled, and scripting language means a language that interpreted rather than compiled,
then what is java?
Is java a programming language because it got compiled before being run?
Is java a scripting language because the compiled language is reinterpreted by the JVM to the native machine code?
Then what about Java implementation with Jit? Isn't that makes java into a scripting language?

all dynamic langs are shit, especially including Lisp.

This is incorrect.

There's no need to learn Ruby when you could be using Python instead

All statically typed languages are shit for low-IQ programmers who can't keep track of types. Congratulations on being on the level of an average Pajeet.

it's not, more and more modern system langs are coming out with enough QoL stuff to make them as or more convenient than script shit. The age of Java and C family plague is coming to a close.

But user, Ruby is much better than Python.

You should learn Idris instead though.

>his custom filesystem cannot even store more than four inodes per directory

Java and C are not dynamically typed.

I have a bunch of text that I search for particular content. For the most part I use a list keywords. Some of those keywords are equivalent of a 100 percent match. Other keywords suggest only a probable match, the text has to be checked manually to see if the context where they appear is correct. Said context is not systematic. I'm wondering if it's worth worth developing a probability system of some kind and if yes, is there any name for it to read more? Can't find anything on goolag.

5/5

Being off by one indicates that your post is shit and that dynamic typing is superior.

i meant that as a separate point, but Ruby and JS are getting replaced pretty rapidly by type-safe languages.

thanks

Source?

Java is dynamically everythinged since it runs in a virtual machine. The fact that it even has a "static" keyword is insulting.
C may as well be dynamically typed since types basically don't matter.

All code is dynamically typed because there are no types in binary

>it's another "Idris/Haskell/FP-memelang-2017 is replacing C/Java/Javascript/Python/BASIC/C++/Brainfuck" episode

False, the JVM is dynamic. Java is not.

Watching a lot of conf videos from all realms as well as reading a lot of articles and company blogs.

The JVM is Java.
Java is the JVM.
They're inseparable. Any language that works exactly like Java in black-box terms, but doesn't run on the JVM, would technically not be Java.

>Haskell is a memelang

The JVM knows nothing about Java. It operates on bytecode. That's how languages like Scala, Clojure and Kotlin can exist.

Agda is the best programming language to learn first.

>using Python

Which one?

spamming this won't make it true.

I agree, I'm merely spreading awareness.

sell me on Agda

Python 3, the latest framework I used for example required Python 3 so I figure this is a good time to move on

Yeah but then I can't use

what do?

What's the use of structs in c++ when classes do the same thing?
Is it just easier to deal with when you're only using variables? Or is there an actual benefit to it?

The bytecode ISA is deliberately tuned for a language with semantics similar to Java and this limits the range of languages which can be effectively implemented on the JVM.
That's the reason why reified generics in Kotlin suck and are restrictively contextual, and none of these languages have user defined language types.

Capable language with very powerful capabilities for telling you if you've fucked up, gets you into the habit of stating your intentions precisely, and at the same time it has far fewer corner cases to trip newbies up than in more common 'first' languages like Python and Java. It's a great language for beginners.

>haskell is not a memelang
>haskell has ever been anything but a memelang
>haskell will ever be anything but a memelang
>it is possible for something remotely resembling haskell to exist without being confined to the eternal meme heap
>it is possible for any language inspired by type theory memes to exist without being confined to the eternal meme heap

I was just wondering about the "firstlaunch" variable. Why is it needed?

Most Python 2.x libraries have been updated to work with Python 3

Else you'll just have to update the script to make it compatible and contribute it as OSS

>I made a pool allocator but I malloced the memory that's to be used for the pool
The thing here is that you wouldn't need malloc to perform your allocation, you might as well just request pages. You're not using a malloc-based memory allocator for your linked list. It's used to set your arena allocator up (but not required, as I said you can use virtual pages or even as you mentioned rely on static segments).
>I say it's the way you use the chunk if memory that matters
I agree. But I don't see how that relates to the post you replied to, or the initial post. Here the intrusive free list is part of the object pool allocation scheme. Unless we don't have the same idea of what a free list is. I'm referring to the fact that when deallocating an object, rather than just forgetting about you you can make it point to the current chronologically last free memory block and update a pointer in your allocator to it, making it the new last block. This way next time you need to allocate in your pool you have O(1) access to it. Actually when you know the size of your objects ahead of time it's the most efficient way to allocate. Alexandrescu talks about it at some conf.

>with semantics similar to Java
>similar
JVM bytecode is optimized for a language like Java, but it's not exclusive to Java.

It is informative to the programmer. A struct is presumed to be nothing more than a named bundle of data items. A class is anticipated to behave in more complex ways.
If you're making a simple data type that has no constructor or destructor, no access protection, no inheritance then just call it a struct.

How about for someone familiar with FP/P already?

Idris

Java relies on the JVM. It doesn't matter that the JVM knows nothing about Java, the fact of the matter is that any language that's fully interchangeable with Java for all possible source code, but doesn't run on the JVM, is technically not Java. That is, running on the JVM is a defining feature of Java, that distinguishes it from any other hypothetical language that's otherwise exactly the same. So, yes, Java is dynamically typed, because the JVM is not a real computer, and the JVM is an indispensable part of Java.

So it doesnt display a notification when i launch it.
It should be True but i had it on False for debugging when i created the hastebin

well good, i'm already using it then. Agda seems nice, but i don't see a reason to use it over Idris since it's even less adopted.

Splendid choice.

Your logic is flawed. You could say the same about Haskell being dynamically typed. In the end it gets compiled down to machine code which is dynamically typed.

Machine code isn't dynamically typed. It's statically and weakly typed.

>haskell is a memelang
>haskell has never been anything but a memelang
>haskell will never be anything but a memelang
>it is impossible for something remotely resembling haskell to exist without being confined to the eternal meme heap
>it is impossible for any language inspired by type theory memes to exist without being confined to the eternal meme heap
>type theory is memes
>type theory is not the opposite of memes
>the things which are not inspired by type theory, such as high performance computing for microcomputers, are not the memes here
>performance is ever under any circumstance less memey / more important than elegance
you probably even own a raspberry pie
that wasn't a typo you fat fuck

>machine code is typed
There is literally no type attached to any data in registers or anything. CPU performs the operations regardless on the incoming bits.

>You could say the same about Haskell being dynamically typed.
You couldn't, though, because Haskell doesn't have a virtual machine.

The operand to each instruction has an implicit size. The size is the type.

>>it is possible for any language inspired by type theory memes to exist without being confined to the eternal meme heap
How do you reckon?

>n-n-no u r-rong

...

Hi, Pepe The Frog!

>implying "no u rong" hasn't been literally every argument in this conversation from either side since the beginning

Should this thread be renamed "programming circle jerk"?

You guys don't post anything interesting and are always circle jerking about irrelevant shit.

Advocating for meme languages, yet don't do anything useful with it.

The same .jar (java exe) can be ran on any machine.
But the same JVM (java virtual machine) can not.
Each processor type/os needs its own JVM compilation.

dumb frogposter

Why would type theory memers ever produce a usable programming language? They're always either perma-NEETs or academics, so they don't have to actually create working products for a living. They have no incentive to be productive or create productivity-enhancing tool, and even if they wanted to, they wouldn't even know what the requirements are.

>implying Sup Forums does useful things

What's wrong kid?
/dpt/ didn't like your memelang?

That has nothing to do with the theoretical possibility of a Curry Howard systems language.

dumb frogposter

Take note lads, this is how you design a language.

dumb frogposter

dumb frogposter

>That has nothing to do with the theoretical possibility of a Curry Howard systems language.
It's fundamentally impossible for the sort of people interesting in that to produce anything useful, so it doesn't happen. I really don't care to discuss your purely hypothetical universe where the people who care about type theory are productive members of society.

dumb frogposter

>It's fundamentally impossible for the sort of people interesting in that to produce anything useful,
TIL theoretical physics isn't useful

real programmers don't use abstractions. real programmers get shit done with languages like javascript and go

dumb frogposter

Wait, by "meme heap" do you mean a (managed) memory heap or some non-programming related shit?

I actually agree with you, these /dpt/ threads are of little substance and the time people waste in here could be better spent elsewhere such as helping noobs on Ubuntu forums or writing some OSS code

I'm willing to even bet a majority of posters (posers) in these /dpt/ threads haven't even made major contributions to OSS or made their own pro/g/ramming projects, the little products that I do see are gimmicky scripts that anybody could write in a day (or half a day if you hustled)

Don't make fun. It's true that real programmers don't use abstraction. However, they also don't use the only thing worse than abstraction, which is pointless bloat.
Real programmers use C.

how 2 learn math for CS / programming

real programmers produce endless security vulnerabilities

That doesn't make it typed. Untyped lambda calculus has a single "type" as well.

dumb frogposter

Can /dpt/ define object oriented programming?

dumb frogposter

That said, here is my contribution, I recommend everybody reading The Shallows by Nicholas Carr and checking out r/nosurf, I think /dpt/ and Sup Forums as a whole has a problem where they are smart and capable pro/g/rammers, but technology has served to be a major distraction in this day and age and it has essentilaly rewired our brains to always be distracted and unable to focus

Ironically, pro/g/ramming is one of the most intensive concentration activities but that is juxataposed by the very same technology that we use that distracts us to the max degree, I think once we as pro/g/rammers can discipline ourselves we can become proficient pro/g/rammers

suffering
suffering

if you ever use composite data types (e.g. structs, records, tuples), you're working with objects and are doing object-oriented programming

The art of Pajeet.

Real programmers use C and also don't produce very many security vulnerabilities.

Computation as message passing

this is bait but i'll bite
what about variants