/dpt/ - Daily Programming Thread

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

Attached: DPT.png (934x1000, 389K)

Other urls found in this thread:

pastebin.com/ja18BnuA
blogs.msdn.microsoft.com/vcblog/2018/04/24/announcing-a-single-c-library-manager-for-linux-macos-and-windows-vcpkg/
docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html
twitter.com/NSFWRedditGif

C++ is the best language of all time

First for D

shilling for Ruby

This is probably the worst sequence for first replies I have ever seen.

what's your preferred language?

I'll see if I can top it next thread

it really is

haskell

why do gpus even do rasterization anymore
we need full raytracing gpus

I'm sorry we can't live up to your standards for autistic pendantism.

Ray tracing is not nearly as SIMD friendly as rasterization. Branching on GPUs is really slow if it's not spatially coherent (neighbouring invocations tend to take the same branches).

(i know this, just shitposting kinda hard, incoherent stuff is glacial on GPUs)
i really want RPU-style ray-intersection accelerators combined with like 128 core MIPS cpus with high IPC and low clocks to create the ultimate raytracing device.
i'm really autistic.

Some kode in my language.

if "statement" implementation:
(if: ((condition: Any), statement: Expr) -> ()) = { statement; };
(if: ((condition: None), statement: Expr) -> ()) = { ; };

(if: ((condition: Any), (statement: Expr), else_statement: Expr) -> ()) = { statement; };
(if: ((condition: None), (statement: Expr), else_statement: Expr) -> ()) = { else_statement; };


Fizzbuzz (using above implementation of if)
((print if { (n % 15) == 0; }, "fizzbuzz", if { (n % 5) == 0; }, "buzz", if { (n % 3) == 0; }, "fizz", n) : (n: Int) -> Any) (Int, Int) { print a, b; }: ((a: Int, b: Int) -> (Int, Int)

Ideas for new projects are impossible.

- No standard build/dependency/doc management tooling.
- Sum types are utter garbage. std::visit is embarrassing in the world of CS.
- AST macros are extremely hacky
- forward declaration in the age of 2018
- Templates are not powerful enough, not well thought out. Try having a friend function in a templates class and define the friend outside of class declaration.
- Blindly injects code into the translation units, cannot do local/private import of certain symbols without preprocessor hacks.
- STL errors messages do not make any sense. Not C++'s fault but both its real compilers don't make any sense. This is because of stupid duck typing C++ has.
- Insanely bloated standard library yet lacks very basic operations for example, split()
- Tries to be compatible with C source yet isn't backwards compatible itself.
- Lack of stable ABI, the current ones, for example, itanium is neither cross platform nor it covers the complete and the latest standards
- Extremely verbose, especially if you want to write a robust API, the amount of verbosity and potential pitfalls you have to deal with is unacceptable.

People do not use C++ because they like it. People use C++ because there's no valid alternatives. 1) Rust or 2)D w/betterC has a long long long way to go in order to be 1) Useful 2) Polished for people to take seriously.

Voxel cone tracing is quite fast on contemporary hardware, considering what it accomplishes.

make a program that allows me to give it a number and it tells me that number*2

C++ is great at what it does well: supporting a fuck ton of different kind of semantics at a minimal performance cost, letting the programmer analyze the trade offs of different implementations and addressing his software's needs, but it's the right tool for only a minority of jobs. For most computing tasks, that kind of complexity creates more problems than it solves.
But in doing what it's meant to do, it truly is one of the greatest languages.
D is the genius schizophrenic of programming languages. It's got so many great ideas, but just too fucked in the head to make a good use of any of them.
Ruby is indeed underrated in 2018. Shill away, my friend.
The true mark of someone that prefers to being technically correct over being useful.

VXGI is really cool! my inner purist wants PURE raytracing though because i'm autistic as hell. i've kind of always wanted to implement photon mapping and DACRT but i'm really lazy and demotivated.

err, ignore my use of the name of the nvidia implementation or whatever

I'm taking an algorithms class in the Fall that I heard from other classmates will have a lot of C coding involved. I know nothing about C and the professor apparently is very specific about using a "primitive" version of C.

Which book should I pick up that will have me at least proficient after the summer ie 3 months? I can code in Java already.

Obviously K&R.

Just read K&R.
C is actually a great choice of language when teaching algorithms and data structures.

in windows, how do you get the compiler to link several .cpp files together into the same .exe file?

By installing cygwin

i have to study for finals tonight no coding for me! i'm going to learn vue for a summer project though

g++ -osame.exe several.cpp files.cpp together.cpp

Most C is "primitive" C.

There are a few new keywords like "restrict" but most of what you read anywhere will be valid back to C89 standards. I doubt you're learning something more primitive than that.

can you create a makefile in windows?

Let's say I get my BS is something completely unrelated but build up a solid portfolio, would it be worth it to go just straight to a Master program or go back for the undergrad?

Cheers

>go just straight to a Master program
Most colleges won't let you get into an MS program without undergrad pre-reqs.

Anyone using Idris?
Does it have any future?
Is it as slow as haskell?

hello
yes
no because it's not lazy by default.

cygwin or mingw has make functionality.

The true mark of a retard is someone who thinks haskell is some arcane meme lang for academia. You're either a complete fucking smooth brain or you've never bothered trying to learn a language that's actually progressed past the shit we knew about type systems, language design, etc. In the 70s/80s/90s.

Attached: 1519439855620.png (932x944, 241K)

Find a niche technology to care about, they provide countless personal projects.

Attached: aaaaaahhhhhhh.png (853x613, 91K)

Not him but although Haskell has a robust type system it's less efficient due to many reasons.

public MainForm()
{
InitializeComponent();
new SnakeSettings();
gameTimer.Interval = 1000 / SnakeSettings.Speed;
gameTimer.Tick += UpdateScreen; //wtf is this?
gameTimer.Start();
StartGame();
}
can someone explain to me how does this perform a paint? i know that gameTimer.Tick will incur an event whenever a timer is hit, but what exactly does UpdateScreen return?
pastebin.com/ja18BnuA

EMBRACE
blogs.msdn.microsoft.com/vcblog/2018/04/24/announcing-a-single-c-library-manager-for-linux-macos-and-windows-vcpkg/

how would i insert a node to the front of alinked list if all i have is a reference to next?

change majors

bookCart = (FXCollections.observableArrayList(
new BookCart(selectedBookNames.get(0),
selectedBookPrices.get(0)),
new BookCart(selectedBookNames.get(1),
selectedBookPrices.get(1)),
new BookCart(selectedBookNames.get(2),
selectedBookPrices.get(2)))
);


How can I write this, but have it be scalable to take in an n amount of items?? The for loop I tried to write only passes the last value to the variable.

Reading about out-of-thin-air executions and self-satisfying conditionals and my brain is melting.

What do you apply those too?

Apply them to something, the concept will come easier

>make out
ehehehe

Attached: Screenshot from 2018-04-25 12-46-13.png (622x104, 13K)

made me giggle
wanna be friends?

only if you promise me you won't touch me anywhere weird...

That syntax is disgustingly verbose. I have never seen such verbose pattern matching in my life.

I just realized Rust doesn't have decltype
Feeling so down rn

Attached: tumblr_nklxgaMeXp1t5cczno1_400.gif (400x225, 1.99M)

oh
i wasnt trying to make some kind of sick joke

what do you think i benefit from learning rust? i ask my prof and he knew nothing of this shit. seems too obscure to me

Rust has many low cost abstractions without any GC. Hence you get built in static analyzer, module management, testing suite, documentation and all other bells and whistles of modern languages.

Rust doesn't need decltype though.

I have no idea if that has the standard procedures of an arraylist but if it does, you want to use add my user.
array blah = new array();
for(int i = 0; i < n; i++ ) {
blah.add(new Benis(meh.get(i), bleh.get(i));
}

docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html

why so?

Attached: Screenshot from 2018-04-25 13-18-34.png (3840x2160, 420K)

Say you had this signature in C++:
auto foo(auto x, auto y) -> decltype(x + y);

In Rust, this becomes:
fn foo(x: T, y: U) -> T::Output;

This always works because of how overloading is restricted to traits in Rust.

why you guys use these ugly languages is beyond me

>benchmark_game.jpg

Looking at that signature makes me wonder if Mozilla gets funding from hand specialists.

Thanks! You were close but got me on the right path. This is what worked

bookCart = FXCollections.observableArrayList();
for (int i = 0; i < selectedBookNames.size(); i++) {
bookCart.add(new BookCart(selectedBookNames.get(i),
selectedBookPrices.get(i)));
}

Oops, obviously should be +/Add or */Mul.

Not having to occasionally write signatures like that comes with a loss in expressivity.

good job. I didn't write it out for you of course. Thus the Benis.
>
Don't indent it like that. You should usually only indent for {'s and multiline statements.

I'm completely retarded.
how would I enter x2' + sin(x1) = 0 into ode45 for MATLAB? Every form I write it in turns up an error of some sort

Hey Jow Forums new to programming here. I want to pickup swift to develop some apps but not sure where to start. I prefer not drag-dropping because i heard that when you start to build more complicated projects that method is inferior to coding so I want to learn it the good way first. What are some recommended books, videos, or class for total beginner?

Have you another image of denotational semantics?

Have in person c++interview tomorrow. What am I in for? I'm confident but want to know if they'll throw any curveballs

they'll show you a picture of a street and ask your opinion on it

Only operational, as it's for an imperative abstract machine.

>auto main() -> int
get out

I'll tell them it's shit. Will I get the job

They probably won't ask too tricky of shit. Reverse a string, do factorial, fizzbuzz, and a simple exercise in whatever domain specific shit you're being hired for. If they whip out some insane shit, you don't wanna work there.

If you did a phone interview, you're already in a good spot, so just try to stay calm and composed. I'll be honest I was shaking at the interview for the job I wanted in front of a manager and 3 senior developers. But since I sequestered my autism and managed to shakily explain my Fibonacci function, they sent me an offer.

>fizzbuzz and fibonacci interviews actually exist
what the fuck? the (one) technical interview i had asked me to write tree stuff and some dynamic programming problems

>t. C++ standardlet
you get out

What are you working on if I may ask?

is retarded syntax the hot new meme these days?

It's from a paper about a new weak memory model that's better than C11's memory model. I'm working on a dependent imperative type theory.

no, it's the lifeblood of sepples

Never mind, I'm more retarded than I thought and fucked up converting x'' + sinx to a linear system.

Interesting, you have some papers/code about that?

On a side note: I get why one would use operational semantics - since it closely related to the state model, but wouldn't it be easier to reason about the semantics if one would translate C++ into denotational semantics?

Hey DPT, I'm currently looking for resources to help me learn C. Should I learn something else before learning C?

yes, you will give up and think its retarded that you have to manage memory yourself when there are languages that do it for you, it is unintuitive for a beginner unless you have knowledge of hardware and atleast basic computer engineering

People say the K&R book is good. Continue with C.

>malloc and free are unintuitive
Do you accidentally steal the shoes at a bowling alley?

>Interesting, you have some papers/code about that?
Hoare Type Theory is about the closest thing there is to what I am going for.

>wouldn't it be easier to reason about the semantics if one would translate C++ into denotational semantics?
It would be, but that is a very hard problem.

Damn, Perl 6 looks like THAT?

Attached: Screenshot from 2018-04-25 00-34-33.jpg (794x984, 88K)

>Do you accidentally steal the shoes at a bowling alley?
heh

Is it worth it to learn how HTML and CSS work in order to better help my understanding of JavaScript?

Do you plan to work with the DOM?

>how they work
you mean like how it's rendered? not necessary at all, but knowing them helps if you're doing that kind of stuff

A+ prep

why post this? it's not even programming

Not necessarily, but I'd like to know about it in case it ever came up for some reason.
I'll check it out, if only for curiosity's sake, thank you.

I'm now on a AI project, so I'm just now amazed by the power of functional programming.

Just installed xmonad, reading the wiki and happy to have so much control over pretty much everything. It was not a meme, today was a good day.

Am I stupid for using pic related as my C++ IDE?
Are there any better ones out there?
(Using Linux here.)

Attached: picrelated.png (500x500, 23K)

vim

>AI
>functional programming
Unless it's classical AI that shit's all about hiring indians to classify datasets and dude matrices lmao. Are you sure hasklel is a good fit for outsourcing to india and programming gpus to crunch numbers?

Yes. Yes. It's Qt Creator. Start a plain C++ project with CMake build system.