/dpt/ - Daily Programming Thread

Old thread: Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Attached: lisp.png (1935x1161, 67K)

Other urls found in this thread:

en.wikibooks.org/wiki/Ada_Programming/Strings
gitgud.io/
teknik.io/
blog.teknik.io/uncled1023/p/1737
hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/src/GHC-Tuple.html#()
youtube.com/watch?v=uiJycy6dFSQ
twitter.com/SFWRedditVideos

>No anime
>Shitposting in OP
Low quality thread. Piss off, OP.

Attached: 1561886399060.jpg (1680x1200, 1.85M)

Anime

Attached: 1400802679401.jpg (500x213, 43K)

...

install Shen

Attached: [Coalgirls]_Yuru_Yuri_06_(1280x720_Blu-Ray_FLAC)_[F8694A5A].mkv_snapshot_21.17_[2018.07.11_11.39.11] (1280x720, 1.27M)

Do you keep your code online? If so, where?

Anime website.

Attached: 1416948965568.jpg (742x720, 52K)

install gitlab
free private repos

Can someone explain to me, in a moderate amount of detail, why the way Ada implements strings and subsequent string types is a bad idea? Someone in the previous thread was complaining about there being 9 different types of strings, but giving no rationale behind why those 9 string types exist nor why it's a bad to have more types. This article: en.wikibooks.org/wiki/Ada_Programming/Strings presents strings in a very sane way it would seem to me, but I'm no Ada programmer.

github has free private repos

gitgud.io/
teknik.io/

Attached: bearhello.jpg (748x744, 798K)

strong static typing is shit

>M$

and a cleaner ui that doesn't take seconds to load

Why?

>teknik
shieeeeeeet

this still exists?

Anon4, I took your advice and started learning JavaScript! I think it's really cool! Thank you, Anone!

Attached: 1561866806599.jpg (1200x800, 93K)

I keep mine on github. I don’t want to lose it so it’s better to have lots of people clone or fork my code so it never gets lost.

blog.teknik.io/uncled1023/p/1737

Good. Afterwards, learn Lisp.

If you want a case study, observe GHC's tuple implementation.
hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/src/GHC-Tuple.html#()

top kek, you have to convert string X to string Y every times you do IO.

data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__
= (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__


>Manuel says: Including one more declaration gives a segmentation fault.

Attached: jake_gyllenhaal_nightcrawler.jpg (600x637, 43K)

>lisp
no jobs

Way too many retards here that don't even have an understanding of the languages they hate. You faggots learn one language and decide that because it's your first language it must be the best. Fuck all of you.

Attached: 1396894468687.gif (500x300, 979K)

Yup. If you don’t kinda hate the language you love the most, I don’t care about your thoughts on programming.

Attached: 64C1D411-2597-4859-AD92-247CACFC57BF.jpg (700x556, 96K)

>implying python isn't the best language

this is just haskell being retarded
this isn't a problem in idris

Anyone who's used strings that aren't just ASCII char arrays will appreciate a type system with multiple string types.

>idris
who
why do you keep spouting meme languages no one uses

idris is the good version of haskell

Got some collision working! Starting to look like a game now. Just need to add a scoring, a scoreboard, and maybe a main menu.
Feeling great right now.

Attached: 2019-06-30_07-13-02.webm (1280x644, 2.7M)

see

you only deserve to hate on a language if you've written 1M+ loc in it:
youtube.com/watch?v=uiJycy6dFSQ

>someone else spreading the wisdom of Paul to deter people from falling into the shitlang trap
I'm proud

gatekeeping

>you only deserve to hate on a language if you've written 5M+ loc in it

Attached: 16988859.png (132x132, 2K)

Who's into Python GUI programming? What's your favorite module to use for it (e.g. Tkinter, GTK, Qt, etc.)?

qt

gtk vs qt
which one is better?
why?

Haha.

Attached: doomguy_icecream_big.png (134x132, 3K)

new to functional programming would appreciate some help.

let's say i have the following pseudocode, OOP style

class TableGenerator {

// Instance variables
Array headers...
Map options...
Array rows...
...

public TableGenerator(instance variables) {
// Set instance variables
}

// Most procedures go here
public void setHeaders() { ... }
public void setOptions() { ... }
public void addRows() { ... }
...

// Method that puts it all together
public Table generateTable() {
Table table...
table.setHeaders(title)
table.setOptions(options)
table.addRows(rows)
...
}
}


i'm trying to rewrite this in lisp, and so far i have just put all of this in a massive function

(defn generate-table
[headers options rows etc... ]
(def headers (set-headers headers))
(def options (set-options options))
(def rows (set-rows rows))
(def generate-table ())
...)


i understand this is probably retarded but i'm not sure how else to do this

Alright, I'mma fucking kms if I have to keep working this shift work shit. Whats the most marketable language out there right now and whats the minimum amount of time I should spend a day learning it? I want to avoid getting burned the fuck out after spending 12 hours a day reading a book and swapping to a screen again and again.

you need to cleanse your brain of POO and embrace free functions and types.

so should i just replace those "instance variables" by functions or what?

Java or some fag web language

webfag language? You mean like jscript, html5, or some other useless shit? Java seems aight, but I'd rather learn something balanced between versatile and practical. Though I may be misremembering about Java.

Once you learn one language it's easy to pick another one up. Literally just pick one and start learning. I'd recommend something like python or C.
You're too early on to worry about use case.

>most marketable language
>C
Dumb Cnile

Most marketable are Java, Python, JavaScript, C#.

I worry about it cause I want to get the fuck out of this life ASAP. I have like 6-8 months worth of sanity left before I go nuclear. And I feel I have the aptitude. They all come easy for me, I just go balls to the wall before some shit happens in my life leaving me dead inside and incapable of getting out of bed let alone studying. Also why the fuck do spiders keep dropping from the ceiling onto my computer?

Attached: 1561780501337.png (500x445, 102K)

dumb fag can't read an entire post.

Again, I'd say something like C or python. You can easily pivot from those two languages to literally anything else. In 6-8 months we may all need to learn some memelang like V because reasons.
Learn mechanics before you pursue specifics.

Attached: 1561839203670.jpg (521x509, 38K)

C# and JavaScript are the easiest to learn and use but both are webshit.
C++ for desktop, gayming, and linux sysadmin if you add Python along.

So many spiders...

>C#
>webshit

Everything is webshit.
C++? Webshit.
Lisp? Webshit.
Hasklel? Webshit.
C? Webshit.

C# isn't webshit you mongoloid

>he doesn't write his webshit in C
I do. My website loads in

>

Depends on your city. In mine, there's a 2x ratio of Java jobs vs other mainstream languages. And if Pajeet can learn it, so can you.

Whether you like it or not if you want to get a job, Java, JavaScript, Python and C are the way to go.

C# is better for job prospects than C but then you're stuck in Microsoft lockin

I really hate this brainlet meme. NET Core exists you fucking morons.

What advice would you give someone who live in rural America who has a CS degree, but no programming job?

Mate what are you on about? Literally all ranks of language use will put C# in the top 3-5 languages (the other 4 being Java, JavaScript, C and Python). I'm just saying it's popular.

>C#
>webshit
C# can make console, desktop, web, soa, etc

...

So can JS

Attached: 1547060651349.png (473x675, 361K)

some people still believe c# hasn't made any progress since 2005. they still believe that java is more advance than c#.
BEHOLD! JAVA HAS LAMBDA NOW!
BEHOLD! JAVA HAS VAR NOW!

just tape it down

Attached: 1538548421095.jpg (740x583, 85K)

Today I learned that Rust will turn off runtime checks in some cases if you compile with -O.

F E A R L E S S

So you just end up with a segfault instead?

I'm not sure, but it lets you overflow integers with -O and not tell you.

It turns them off when they're redundant

// Unoptimized
if x < 10 {
if x > 10 {
panic!();
}
println!("{}", x);
}

// Optimized
if x < 10 {
println!("{}", x);
}

>they're redundant
I don't think so user. This code below compiles and runs with -O giving me -112, and that's with a static value it could check ahead of time during compilation.

pub fn square(num: i8) -> i8 {
num * num
}

pub fn main() {
println!("{}", square(20));
}

Just seeing if I can post with this firefox profile.

Attached: 1561832161361.jpg (597x489, 28K)

> write a comment "//implement this pls"
> compiler doesn't implement it for me
wtf

Compiler doesn't care about comments, they are just whitespace from a compiler's point of view

>when they're redundant
You should probably not say that it turns off runtime checks then. They're just statically proven to be dead code in the optimization stage of the compiler.

Imo that's less confusing.

Be careful what you wish for because lots of people are working on program synthesis, then you won't have a job.

Attached: 1561757763288.jpg (1280x720, 182K)

Program synthesis is just a fancy name for logic programming.

I wouldn't mistake how something appears for its implications. Transliterating a logical statement to a series of imperative statements in x programming language would be comparatively trivial.

>beginner dev at job
>notice internal library we use
>make some changes
>runs multiple times faster and code isn't more complicated or hard to understand
>repeat this 3x times
>realize this is probably doable throughout entire stack everywhere
Software is so fucking slow, we've been coddled by continuous improvements on hardware side for years.

Attached: 1558798059874.jpg (250x246, 12K)

>behold, java has unsigned ints now

Attached: george lucas laugh.jpg (1796x1530, 887K)

Bad software design has since penetrated hardware and is baked in, unfortunately.

what did you do to improve the performance of the code?

trying to learn SFML with C++ and I have no idea what's wrong. I try to compile the code below and I get the error in pic related

#include

int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");

return 0;
}

Attached: error.png (1280x184, 7K)

>spend work hours doing things nobody asked you to do
>get fired

hopefully they had tests (or you wrote some before 'improving' the codebase)

OK, integer overflow is different. The default way to handle overflows depends on whether you build in debug mode (it panics) or release mode (it just silently wraps around). There are like a dozen ways to specify which behavior you want, if you prefer it to always be consistent.

you're not linking sfml

>mental illness

how do I do that? Sorry, I'm new to g++. I thought it would read the headers and figure out what it needs to do on its own

g++ test.cpp `pkg-config --libs sfml-all`

Learn Lisp.

Something like -lsfml

>wrote custom data-structures that match problem domain
>removed funky code paths and call hierarchy that wasn't needed
>removed duplicate work and expensive objective creation being done unnecessarily
>lots of random small costs that add up
>etc
Of course, unit tests, some ad-hoc fuzzing, and captured production data to verify input/output.
[spoiler]30k raise :^)[/spoiler]

>wrote custom data-structures that match problem domain
>removed funky code paths and call hierarchy that wasn't needed
>removed duplicate work and expensive objective creation being done unnecessarily
Basically you made it less OO. OOP btfo yet again.

Attached: devilish.png (400x400, 174K)

>g++ test.cpp `pkg-config --libs sfml-all`
thank you user! Now I just need to figure out why that works

Attached: file.png (1027x731, 60K)