Old thread: What are you working on, Jow Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
github.com
github.com
github.com
itworld.com
benchmarksgame-team.pages.debian.net
archive.rebeccablacktech.com
youtube.com
twitter.com
Trying to read up on the fucking new features of C++.
doing leetcode with sepples and failing. pretty sure my solution is right in theory I just suck at c++
just use the features you know
Why have there been so many sepplescucks in here over the last several months? Why don't any of you shiteaters learn a language that isn't pure trash?
It's freely available on all platforms, it generates fast code, and in the commercial world outside it's often what the customer has already and wants you to modify.
>Want to implement feature A
>If I implement feature B first, that will make feature A easier to implement and be doable more cleanly
>Want to implement feature B
>If I implement feature C first, that will make feature A easier to implement and be doable more cleanly
>Want to implement feature C
I'm fucking like 4 or 5 of these deep at the moment, with thousands of lines of code worth of partially implemented features waiting on more work. When will it end?
Because it's the most powerful systems programming language there is.
>It's freely available on all platforms
So is literally everything.
>it generates fast code
C and Rust are faster in general.
>in the commercial world outside it's often what the customer has already and wants you to modify
This isn't the wagecuck thread. There seem to be actually insane people here who _enjoy_ C++ and use it on their own time.
bump n dump
anime garbage :)
>tfw last glimpse of motivation I can find is in making Akarin proud
>Rust
The eternal tranny is behind it again.
>tfw even Rust developers have to use unsafe to do anything
>mr/mrs. Without boats, ximself
>Pin
In sepples you don't need this because you have programmable move semantics.
>make very clever library/tool to do X in milliseconds where existing tools took minutes
>publish two years ago, few people care, a couple citations here and there
>make extremely clever library/tool to do Y in several seconds where existing tools took several hours
>publish last year, few people care, a couple citations here and there
>make trivial Web application that's just a front-end for X and Y working on the back-end
>publish a few months ago
>everyone is super excited, huge interest at conferences, already more citations that the X and Y papers combined
I'm happy but I'm also sad.
link the web app
>So is literally everything.
Yeah, except literally the second language you mentioned, lmao.
>mutt
>unsafe
you have to be a tranny to think that rust is even a half-decent lang
>Because it's the most powerful programming language there is.
ftfy
>template template parameters
yikes, that's enough of C++ studying for today (it isn't, my exam is coming up in 2 days)
based and HKT-pilled
Huh, I didn't realise there was a school for coprophagiacs.
Template template parameters are incredibly useful, otherwise you're stuck using shit like "rebind" if you want to say implement a function like fmap.
Not powerful enough. So far it only supports class templates and alias templates, we need the ability to pass variable templates and function templates as arguments to templates.
I enjoy Perl. I like the way hash arrays and regular expressions are not just library functions that you call, like in Python, but are actually built into the syntax of the language.
I know, you can do freaky shit with Perl that renders it unreadable. I used to work for a guy who proofread all of O'Reilly's books on Perl. He was infamous for his one liners. One liners that got the job done, but weren't understood by the rest of the team.
The point is, you don't have to do freaky shit in any language, be it Perl, Python, or C++. In fact, doing so is antisocial. Keep in mind there's always a next guy who's supposed to update your code after you're gone. Or, which is even worse, that you may get called 8 years after you have done some shit. "Hey, user, it was you who did the code back then. Could you just come in and add XYZ?"
Think of that, people.
messing around with using a jupyter front-end with the free version of the wolfram engine. seems pretty good even if it's missing some of the niceties of the full mathematica interface. 3d plots and manipulate are non-interactive but the latter gives you a little animation of the parameters which is cute.
What can you make with C++?
this reeks of autism
everything
rajeesh-resistant object types called pointers
you made a jupyter kernel for wolfram?
>regular expressions are not just library functions that you call, like in Python, but are actually built into the syntax of the language
Too bad Perl regexes are an inefficient cancer, that took a huge dump on very good theoretical computer science, and caused heaps of other retarded languages to follow suit.
You can't even call them regular expressions.
Learn a Lisp.
>variable templates
But this is already possible,
template
works fine
>function templates
just change every instance of
template
Foo func(const T&) {...}
into
struct Func {
template
Foo operator()(const T&) const {...}
};
const Func func;
The semantics are exactly the same, and the compiler will optimize out the this call. Writing your template functions this way makes passing them as arguments to higher order functions and such much less painful.
maybe this is C++'s version of "fully saturated"
like Haskell w/ type families
Make a Lisp:
github.com
oh you're just using it, my bad
never used the wolfram language for programming before, is it good for anything besides mathematical applications?
yeah you can do a lot with it.
i remember a thread on Jow Forums a while back where a guy was asking about tracking a heart cell's activity. i used it to make this.
>we need
Speak for yourself.
Maybe you should start thinking of using a loosely typed language instead.
Memes aside, is there a reason to use a Lisp rather than Haskell for general application development?
>iterating a collection changes its state
The Book (Structure and Interpretation of Computer Programs) by far surpasses anything written on Haskell.
Unless you are pressed for time, I highly recommend you try both approaches so you can make an informed decision for yourself. But learn Clojure instead of Lisp, which is outdated.
Some people find that static type systems make it very difficult to develop large systems.
Some people find the opposite.
Dynamic typing shouldn't be allowed anywhere near something that isn't shell-script-tier.
Racket deserves a mention as well tbqh
very nice, you're generating that animated graph from the video?
what does the code look like?
You don't even need template template arguments at all under this logic, you can just do
struct TemplateBox
{
template
using Template = ...;
};And invoke the template indirectly.
But that's fucking disgusting, I want to do it directly, I don't want to jump through hoops.
I did some HackerRank and 99 Haskell Problems challenges in Clojure, but didn't like it. The thrown exceptions were cryptic and I missed pattern matching.
Aside from playing around with Dr Racket (the stepper is really nice), I haven't really used it.
Lisp gave us Grammarly and iirc Expedia. I can't think of similarly large commercial Haskell projects offhand.
What makes any of those things bad?
There is a library for pattern matching (github.com
Rich Hickey (Clojure's author) dislikes pattern matching because it is not open for extension (unlike multimethods) and because if you need to change the pattern then you must fix everywhere in your code that uses the pattern. He prefers code that can safely ignore what it doesn't need to know about.
>Racket
John Carmack likes it:
itworld.com
What are some projects I could work on? I want to deploy some real world site using amazon free tier servers, but can't think of what to make.
I think you're getting confused, templated types and templated functions are two completely different things
Using aliases like what you posted are for types, not functions, and you CAN pass templated types as template template parameters, so there's no need to do what you've posted
What I am talking about is the case where you have a templated function (not a type) that you want to pass somewhere, without instantiating the template
In this case, promoting the template function to a callable type with a templated call operator is a graceful solution
What's your use case where you want to be able to pass a function template directly as a template template parameter?
>Webshit
Why don't you actually try some real programming, where there are actually problems to solve?
Go for a walk and think about what kinds of services would improve your life or the lives of other people.
C# chads how do you guys upgrade your skill
Eventually.
Believe me, I love OOP because the more you divide the code, the clearer, easier to debug, more reusable and better suited to implement design patterns with.
Just keeo doing code like this and the moment you fibish creating those 15 classes it will be for the best.
Unless you have a deadline, in that case just make A and let others improve it instead.
F#
Thank you, user of the pre-pre-previous thread, for mentioning libgen.io.
I was able to circumvent my ISP's block of the site and download a book on Racket. I always liked Scheme, so I'll check it out.
That's definitely true. Haskell books are average at best. SICP really is in a league of its own. I worked through the first chapters, but dropped it due to time constraints.
Unless you're really disciplined with unit tests (which most companies are not), static types are a must for any reasonably sized project worked on by multiple people.
As for my pet projects, both have their pros and cons.
Facebook built a spam detection system in Haskell IIRC.
Thanks, I'll check out the library.
Rich Hickey is a cool dude, but I don't always agree with him.
Regarding libraries in Racket, how is library support? HTTP client, XML parser, ncurses support...
It solves a lot of problems with "could not resolve overloaded address" errors.
We have template already so I don't see why we can't have template and template
The point I was expressing before is that you can always just put your template in a type and pass the type as an argument but this is really ugly and unwieldy to use on top of being undescriptive.
We have our intern rewriting scripts from perl to python because previous contractors defaulted to using unreadable one-liners everywhere in perl and even commenting
>this is a hack
or
>it just works
Ah, I just realized that by variable templates you probably meant templated values, and not variable length templates. Yes, I suppose it would be nice to be able to pass those, although since they're pretty much always attached to a types you can usually just pass the type and then type ::value or whatever.
Does -fno-exceptions make every function noexcept?
It's completely absurd how the C++ committee are focused more on turning template metaprogramming into a proper language than giving us fucking modules, a feature that literally every C++ programmer wants.
C++20 is getting modules. Also everything since C++11 has deemphasized template metaprogramming in favour of constexpr.
Basically yeah, but the distinction is maintained in the type system.
So true,
The reason I keep using Java, Node and Python is not really for the easy difficulty of them, but for the tools, libraries and frameworks they have.
I guess I also use PHP for the same reason but I would never use C++ for doing anything web related.
And anyways I always end up making Spring projects so fuck PHP.
I think the standard library is still compiled with exceptions with that on GCC so if you're using something std and you fuck something up your whole program can blow up. Could just avoid using the standard library though.
My first student job was at a big logistics planner that did actual work with Perl. That's where I got to learn it, only with a newer book than what my boss had. I remember using variable references, double de-referencing and closures for callbacks, and him asking me "What the hell is that?" He had never seen
$a = \@myarray;
$b = $$a[$i];
>C and Rust are faster in general.
This is a misconception. C++ is as fast as C if you want it to be.
Honestly any benchmark ever will be a comparison of implementations. Perhaps X has a faster implementation of a standard library than language Y.
Also has nothing to say about programming style.
when are they rewriting the STL using constexpr
Benchmarks are pointless without seeing the source code. The reason C++ typically looses to C in benchmarks is because people incorrectly believe there is an idiomatic way of writing C++, and will incorporate the overhead of virtual functions and various std features when it's not necessary.
In reality, you could take the code the C program used for the benchmark, add the necessary translations, and it will run just as fast compiled by a C++ compiler.
how important is understanding SFINAE for learning c++
yep, all the animation is done in the system. if you give Export a list of images with a .gif filename it makes a gif.
couldn't find the original notebook so i just redid it. it was a stupidly simple operation since you can do standard arithmetic with images in wolfram. here's the original thread:
archive.rebeccablacktech.com
bros... I'm not gonna make it
You need to know SFINAE if you want to overload templates.
Don't want to do that? Don't worry about it.
Many people find it necessary to add type checks with clojure.spec or Plumatic's schema library.
That's the problem with sepples. It lacks any one strength. You can make it do whatever you want, but it's not really the best at any one thing. The end result is a lang that's obnoxious to use with no real benefit.
thanks user, very neat solution
Being required to do everything is the inevitable result of being used by everyone.
>reaching more users gets you more reactions
you don't say
I want to fork st and I've spent the last three or so hours in bed
How do you actually work on projects, /dpt/? I feel like whenever I'm not wageslaving, I can't bring myself to do anything that requires more effort than low-quality shitposting
But webshit can just be a web based interface to that "real programming" back end system.
i work on something else, like music
That sounds gay
Maybe make up a schedule? But that could seem too much like work..
Incredibly unimportant for learning C++, but you will inevitably fall down the C++ rabbit hole and become obsessed SFINAE anyway.
don't worry, it is
Come up with a business idea and work on it with the idea that it's going to be your new way to survive.
Think of projects that could make money or become a side business in the future. That way you have the same motivations you do when you are 9-5ing.
Also has anyone used aws containers? youtube.com
Are they better then just docker or whatever?
>Rust
Not actually fast
>Think of projects that could make money or become a side business in the future. That way you have the same motivations you do when you are 9-5ing.
Like what, though
I'm an asperger with no marketing skills, my only hope would be to make something actually useful that people will use of their own volition, but I don't have ideas either
>Are they better then just docker or whatever?
Doesn't it literally say "docket management for AWS"? I haven't used this ever but I imagine it's just something EC2-like but tailored to be integrated with docker. Maybe along the lines of google's appengine, where you just deploy your image instead of ever worrying about more traditional VMs.