/dpt/ - Daily Programming Thread

old thread: What are you working on, Jow Forums?

Attached: K&R himegoto waifux2.png (1000x1400, 1.31M)

Other urls found in this thread:

github.com/nomad-software/dunit)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=plaintext
techempower.com/benchmarks/#section=data-r17&hw=ph&test=update
techempower.com/benchmarks/#section=data-r17&hw=ph&test=fortune
techempower.com/benchmarks/#section=data-r17&hw=ph&test=query
techempower.com/benchmarks/#section=data-r17&hw=ph&test=db
techempower.com/benchmarks/#section=data-r17&hw=ph&test=json
vibed.org/
godbolt.org/z/3X6h3F
godbolt.org/z/0ysxGc
twitter.com/SFWRedditImages

C is obsolete, deprecated and not even turing complete.
No one uses C, not even C compilers. Cope.

You can't spell trust without Rust.

I want to marry Hime

I'm making a Discord game in Python
It's fun

>discord game
how does that work, you type in commands, like some text game?

I use C and C compilers.
C is fast, powerful and very cute.

>C
>cute

Attached: C grugs.png (1200x699, 345K)

how do we finally make C turing complete?

>not even turing complete
Now this is some incredibly weak bait.

You can't spell frustration without Rust.

Educate yourself first before replying to me

Yep pretty much
You start the match, choose your character then it runs through randomised scenarios until a team wins
It's based off of Rainbow 6

Is this going to be that retarded "Hurrr Turing machines need infinite memory and computers don't have infinite memory, so computers aren't Turing complete" or some fucking nonsense?

what language should I learn next

C

>Discord
Stupid gaymurr cuck.

++

Go. Can be done in a weekend.

Trying to use a unit testing framework for DLang (This one: github.com/nomad-software/dunit)

I'm trying to run an example, but I'm running into an issue:
For some reason, despite including it as a dependency in the dub.json file, the d compiler won't recognize the fact that I've already downloaded the library... What am I doing wrong?

Attached: Screen Shot 2019-03-04 at 1.05.11 AM.png (1796x1022, 232K)

You can learn how to be a gay hooker in a weekend, doesn't mean you should do it.

>Deadlang
You may as well be asking for advice on how to use COBOL.

>Implying I don't know how to use COBOL
Besides, isn't that a circular argument? It's a dead language, so don't use it?
It has a pretty good standard library, so I'm just giving it a test run and see if I like it more than C++.

dub fetch dunit

> What am I doing wrong?
You're trying to use a dead language.

>deadlang
but he isn't using C?

When I language has existed for over 15 years and failed to gain any notoriety, you can consider it a waste of time.

It's a dead language, and there's no reason to use it, so don't use it. Other languages are either strictly better (C# and Rust) or are much more popular and thus have better tooling and library support (C++17, Java).

It's telling me that I have the package, but need to add it as a dependency (which I do in the dub.json file).
Tried running dub run dunit, but it didn't seem to work all that well.

Attached: Screen Shot 2019-03-04 at 1.13.25 AM.png (1850x1550, 240K)

It's obvious that it's a library, running it does not make sense. build your project with `dub build` instead of that horrible dmd */.*.d command

D is strictly better than C#. And there are no reasons to use C++ or Rust outside kernel/drivers. Fuck off.

There is a finite amount of matter in the universe. Turing machines do not exist.

Actually C++ and Rust have no place in kernels and drivers either. OSes are already written in C and no one is going to rewrite trillions of lines of code into better languages. What's done is done. D recognizes that and makes itself a practical choice of language for the userspace.

Okay. that makes a little more sense. I previously thought the dub build --build=unittest --config=library at the bottom of the github page was just a one-time thing, not how you actually ran the tests.

I also just remembered why I wasn't a fan of the DLang's testing framework: The error messages are pretty bad when a test fails.

Guess I'll just give Rust a shot.

Attached: Screen Shot 2019-03-04 at 1.24.53 AM.png (1848x1600, 472K)

> D is strictly better than C#
No it's not.
> there are no reasons to use C++ or Rust outside kernel/drivers
Then why stop at D, just switch to JS, Node and Electron, if you don't care about performance and memory usage.

>OSes are already written in C and no one is going to rewrite trillions of lines of code into better languages
You know people create new operating systems for research purposes, right?

D has performance similar to C++ and Rust, unlike C# or JS. Unfortunately for you, true Scotsman fallacy does not work in real life.
yes

Attached: Screenshot_2019-03-04 kostya benchmarks.png (702x4700, 294K)

> nanobenchmarks
It's only true if you're done before GC kicks in. I'd post comparison from the Benchmark Game, but for some reason, they removed D from the list of relevant languages a couple of years ago.

GC is more correct and efficient in handling resources than manual memory management by a long shot. Even Linux has its own refcounting model. Unlike C# or JS, D's GC is deterministic and more controllable.

I want to learn BCPL. Any tips?

> GC
> as efficient as MMM
Only if you use like 5x more memory.

I mean, something I've found incredibly useful when learning anything is to have a notebook (where you physically write down notes, not a document). The act of writing something down helps me learn a lot more.

If you don't mind me asking... why learn it? Curiosity?

> 1974
> learning BCPL
BCPL is an outdated shit, you should check out this new C language, it's really great.

Yes, userspace apps don't run on 4k memory chips. Is it too hard to follow a line of conversation?

c is a trashy rip-off of bcpl

I bet it'll never take off, only hippies would use it.

C is a language for low energy basedboy losers, pic related
kys tranny

Attached: p258.jpg (368x557, 111K)

Is Haxe a meme?

Attached: f1916770-9b74-11e8-927c-71f29759abab.png (300x300, 5K)

Userspace apps aren't islands. If every program on my desktop at a given moment uses 5x the RAM it actually needs then there's going to be a problem.

>D
>similar performance to C++ and Rust
Post the Dead github page and lets all have a laugh

It's ok.

Ok what's your username?

In my case it was raw necessity. Adding rate limits to programs that were too demanding on my network. Extending the debugger of an emulator I needed for a project. Fixing a filename bug with a program so I didn't have to rename files to use it. Stuff like that. I just fixed them or added what I need then submitted it to the relevant devs and they seemed happy with it.

I've tried going through issue trackers as well, but it usually doesn't end well since all the issues that don't require in depth knowledge of the program tend to get solved before I get to them. At the moment I'm going through the backlog of one of the programs and I've found an issue that doesn't seem too old that no one else has touched, so I'm going to try go for that.

>D has no performance because my github is dead

Attached: 1545505078487.png (817x891, 32K)

if 3 lines of code "fix" something, do you make a commit with only that small change or do you try to include other fixes as well and make a larger commit?

i usually follow the "commit small and often" rule

The former

Commits need to be semantically separated and nothing else. If you fix one thing, it needs to be one commit.

If I'm making an ncurses program where I'm essentially making a glorified file-viewer as a part of it, would it be an okay idea to make an array/vector of strings that contain the strings I will send to ncurses?
I did the calculation and in the worst case I'd need about 20kB of memory (assuming the user doesn't do something like resize their text to be tiny).

I'm leaning on "no", but I'm curious how you guys would handle something like this (drew it up in excel for a visualization)

The alternative would simply be to store two "cursors", one for the list of files, and one for the current row in ncurses, and if the current row goes beyond the number of rows (such as being at the start and saying "previous" or at the end and saying "next), I redraw the screen). Am I thinking about TUI's the right way?

Forgot the image.

Attached: Screen Shot 2019-03-04 at 2.49.03 AM.png (758x312, 40K)

I meant the comparison page you mong. It is not maintained by anyone and does lots of idiotic shit like warming up the jvm hence poor performance and large memory use. The code used for many langs is an absymal failure just like you.

You were arguing that D and C++/Rust do not have the similar performance. What the fuck are you bringing up JVM for you autistic mongrel?

Anyone worked with gdb?

I'm trying to get a device to communicate with gdb but it's failing. I'd like to see what commands it is and isn't sending and where is failing to handshake

Do I need to explain that I used it as an example? Change your name to special needs and do the needful

Trying to write useful stuff in F# instead of just short pop puzzles.

Nice backpedalling, faggot. Your example has nothing of value.

You have no idea how make bechmarks and you probably even made that one. I cannot expect nor accept lesser amounts of autism radiating from Dshills.

>get called out for giving an irrelevant argument that doesn't back your claim
>call him an autist
Yeah that'll show 'em
The absolute state of this board

>argument
example*

You don't even know what I claimed.The benchmarks are not maintained nor is the original commit valid for accurate comparison. D is slower than many many languages (even java) and posting dead benchmarks instead of a link to the benchmarks games will only help retards such as yourself sleep at night

Daily reminder.

Attached: 15516984115210.png (1075x866, 1.04M)

>D is slower than many many languages (even java)
Let's see code and benchmarks

qaulity advice

> they will never show D is slow if there are no reliable reproducible benchmarks of D

Attached: ae6ae7737442185976d1e1cc19ea4f4f.jpg (600x338, 32K)

>your microbenchmarks bad
>my microbenchmarks good

Haha, Jow Forums never ceases to amuse.
Java can't simply be faster it doesn't even have CTFE.

>Java can't simply be faster it doesn't even have CTFE.
how does the first part of the sentence correlate with the second?

By adding a "because" in the middle. Hard, wasn't it?

but you can get the result by hand and have the program output it instead? then the runtime speed for both will be roughly equivalent

but he's got a girlfriend

Actually there are real-world benchmarks with D in them:
techempower.com/benchmarks/#section=data-r17&hw=ph&test=plaintext (62nd place)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=update (97th place)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=fortune (137th place)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=query (150th place)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=db (117th place)
techempower.com/benchmarks/#section=data-r17&hw=ph&test=json (95th place)

In c# how do I make a Dictionary without calling the constructors of all the classes in the dictionary when initializing the dictionary? Seems wasteful

what are you trying to do

>D is slow because a web fremwork written in it is slow
In that argument (and that benchmark), Java is faster than C too. Don't delude yourself.

Those "results" are not always that simple in most context and the compilers or the JVM aren't smart enough to detect them too.

Attached: photo_2019-03-04_14-50-20.jpg (750x746, 62K)

Serious level of coping here. The original commit contained this code and even the current versions use map and std::list
std::string str = "";
std::string str2 = "";
for (int i = 0; i < 1000000; i++) { str += "a"; }

unidiomatic nonperformant code written by an absolute retard just to cope.

D-fags are free to write a faster web framework or present any other benchmark. Also the framework calls itself "fast": vibed.org/ , so I had to assume this is what "fast" in D means.

Attached: Screenshot_2019-03-04 vibe d.png (369x248, 8K)

>enum as a key
what are you doing? clearly, it is something wrong.

The absolute state of Deadlang

Attached: 1551053244154.jpg (339x435, 43K)

A factory method returning a class for a respective enum, but I don't need to initialize every class declared in the dick
>just use switch case
Ew disgusting

Is that code still the same or has it changed? Source?
Again, that does not disprove anything I said.
>In that argument (and that benchmark), Java is faster than C too. Don't delude yourself.

ohh lmao

Use lazy initialization?
Use a Dict instead?

>post a screenshot from a github project made by a retard
>get btfo for making shit claims based on shit source
>ask for source
not even /s4s/ tripfags are this ignorant even if they try to be.

I don't get it? What do you suggest "performant"? Looks identical to me?
godbolt.org/z/3X6h3F

Wait, it's not comparing fn1 and 2. I'll have to check again.

retard

>It's same
Who knew
godbolt.org/z/0ysxGc

Should I learn mechanics/physics for my game

No, just use a physics engine.

Can you explain what you're trying to prove here?