Old thread: What are you working no, Jow Forums?
/dpt/ - Daily Programming Thread
>Noooooooo you cant just use that algorithm it has non polynomial cost, you should be approximating it with a quadratic formula!
C++ vs Rust? I like both but everytime i use Rust i think
>C++ already did this so this language is dead on arrival
But when i use C++ i think
>Rust is more modern so this language is dead in the waters
Fuck
Working on a BitTorrent client. Also learning ember.js
Fuck off, reddit.
>ember.js
why not use express if you want to use node instead of being a fucking hipster
developer productivity and freedom >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> memory safety
Unless you are specifically working on something that calls for it (most things don't).
That's really all that needs to be said.
While a more modern slimlined take on C++ would be interesting, rust isn't it.
>0 FP languages supported on Leetcode
Where do I go to practice in a language like OCaml?
Can someone help me, will python be able to load DLL libraries (from C++) when its ran on Linux or do i need to create SO libraries.
A bad place
If you can't be as productive in a memory safe language you're bad at what you do
Use Rust. Package management is awesome
Pick some set of university compiler class assignments.
Or apply for a job at Jane Street I guess
Good luck trying to use C++ symbols from another language.
what C++ symbols
youtube.com
holy shit i feel like brainlet
>If you can't be as productive in a memory safe language you're bad at what you do
It's about the design philosophy, the developer is always right.
Even when what they're trying to do is shoot themselves in the head.
Some fucktarded borrow checker should have zero authority.
God i fucking hope you will never code airplane shit
If you're doing anything with that kind of reliability guarantee you're using MISRA C or SPARK not fucking Rust.
>Not fucking Rust
...yet
Basically, C++ is significantly harder to use from other languages compared to C.
What are you even trying to do?
>C++ is significantly harder to use from other languages compared to C
There are like a billion ways to call c++ to Python (as he wants Python). some piss easy like ctypes or pybind11. its really not that hard
No, Rust will always be inadequate for these purposes. It's simply too complex, too complex for program verification and too complex for the compiler itself to be verified. Whatever the merits of Rust may be, this is not one.
Ahhh... Maki....
>ctypes
Doesn't demangle names.
>pybind11
I'm only seeing support for a single version of the language. C++11 is very clearly pointed out, but C++14, C++17, and C++98 aren't mentioned.
Yes pybind11 works with newer C++ versions
extern "C"
Have you ever worked in a team with other people?
Holy fuck that's autistic
>The constructs that formally verify safety are too complicated
>Let's use some empirical rule of thumb from 90s
Basic Rust isn't too hard. When it starts to stabilize we will see other compilers and lingers and the like. Also you can probably convert a lot of MISRA over to Rust and not use other constructs it provides and be just fine if you truly believe it does too much
We conjure the spirits of the computer with our spells.
Pybind11 supports C++11 and newer. C++98 is explicitly not supported. It's fantastic by the way, I use it very often at work.
>tfw no mommy gf
what language to use to make her
Haskell
You can shoot yourself in the foot of you want to in Rust, just use unsafe
That's like saying C is a genie and takes the worst interpretation of what you wished for
Normally I'm cool with C on small projects, but everything I'm working on now is large enough that there is no tolerance for error (backend for a startup, so failure to keep the books and track payments could land me in legal issues, more issues but domain specific enough that I won't doxx myself)
Is it possible to activate the autocomplete feature in dr racket everytime you type something, like in the jetbrain IDE's ?
ok?
>While a more modern slimlined take on C++ would be interesting, rust isn't it.
Why would that be interesting? Why not just use the features you'd like in C++ and not other parts?
A barebones text editor for the 3ds
There's already Notepad3DS but I'm sick and tired of having know by heart and type the exact path of the file I want to open, simply because the dev didn't even took the time to implement a file selector
I'm an absolute shitter but I still managed to do it, why couldn't they?
those features could be cleaned up significantly
>Compiler should be formally verified for correctness
>Compiler shouldn't formally verify what it's compiling for correctness
Hmm
A tomato!!! So cute!!!!!!
Cleaned up how? Do you want shorter types or a cleaner interface?
Some features in C++ are poorly designed, either because they happened by accident, or because the committee has to worry about backwards compatibility.
Personally, I'd like less hacky more powerful and terse metaprogramming.
You shouldn't ever have to write boilerplate.
There's other problems too, like the lack of a standard integrated ABI.
Starting from scratch, while for the most part unfeasible, solves a lot of issues.
fft wont fucking work
Sounds pretty neat, you should check out Rusts macro system if you haven't, pretty good about reducing boiler plate IME
What language? Are you doing it from scratch?
A program is always correct until you specify the expected behavior.
I've seen some.
I was looking for COM examples and came across a rust COM library.
I will admit rust's macros are neat and make me somewhat jealous.
im learning Laravel
give me your worst insults
codingame.com supports OCaml.
ASP.NET Core is objectively superior
Is there a good chance to receive an internship referral if I've been contributing to a company's open source for a couple of months? Who should I contact in that case?
Are you only a programmer if you are paid to do it/have a contract with someone to pay you?
>What are segmentation faults
>Are you only a programmer if you are paid to do it
No, then you're a prostitute
>contributing to a company's open source for a couple of months
>working for free
>hey Tim, check out this guy
>he did free labor for us, thinking we'd give him a internship
>LOL, tell him ok but it's a unpaid position
why would i join the microsoft sect botnet
laravel was made by some guy and community
Sure. Most companies have a career page, just toss your resume on there and say you've been contributing
What are you talking about nigger
>contributing to libraries you are actively using and interested in = working for free
Laravel is fine, it's the reason why PHP is usable at all.
yes
>dude are you getting paid to work on these libraries?
>nah, but I'm really interested in them
>fix a bug in a open source library you're using
>should I contribute this?
>nah, let's just maintain and update the patch in perpetuity, putting more and more hours into it over time as the library is updated to break the patch
if everyone thought like you, open source wouldn't exist
>M$ releases tons of open source software on Github
>wows people all over the world
>hundreds of people work for free fixing bugs, writing documentation and whatnot
genius move, to be honest
>muh open sores
>muh closed sores
proprietary software makes way more $$ than open sores
stay mad
they had to get someone to write their documentation, i mean have you seen msdn?
open sourcing it at least barely improved it
learn metaeconomics
money is just a shit abstraction over power
people being dependent on you, on the other hand, is power itself, and not an abstraction of it
open source software is inherently more powerful than proprietary software
>github.com
| Language | Real Time, s | Slowdown Time | Memory, MB | Compiler Version |
| *Best tuned s| **0.165** | x1 | **0.25** | |
| Crystal | 0.30 | x1.8 | 1.6 | Crystal 0.25.1 |
| D "garbage co| 0.27 | x1.6 | 1.6 | LDC 1.9.0 |
| D "naive unsa| 0.24 | x1.45 | 1.6 | LDC 1.9.0 |
| Lua | 3.82 | x23 | 2.8 | Lua 5.3.4 |
| LuaJIT | 0.96 | x5.9 | 2.0 | LuaJIT 2.0.5 |
| Nim | 0.47 | x2.8 | **0.5** | Nim 0.19 / GCC 8.2.1 |
| OCaml | 0.69 | x4.2 | 3.8 | OCaml 4.06 |
| Python (CPyth| 11.15 | x68 | 5 | CPython 3.7 |
| Python (Cytho| 5.88 | x36 | 5 | Cython 0.29.2 |
| Python (PyPy)| 3.40 | x20 | 48.5 | PyPy 6.0.0 |
>should I do this thing in LuaJIT or Nim or OCaml or D or Crystla and have it finish in under a second?
>nah I'm going to "save dev time" by writing it in Python instead, then discovering that it's too slow to be practical, then profiling it, then rewriting parts in C, then profiling it, then giving up and rewriting it in C
you were already in the red when you finished the first version. Python isn't any easier than these other languages!
agreed
jesus christ there shitton of theory about design principles and patterns when writing your program
what the fuck do you guys follow any of those?
i kind a just separate my program by files and thats it
>open source software is inherently more powerful than proprietary software
that depends on how many people are using your open source stuff to even be dependent on you
protip : way less than they use the proprietary software wich makes it more powerful than open source
Pay Attention and Avoid RSI Design Principles
>do a thing
>it kinda sucks
seriously why the fuck don't more people use lua(JIT)
it infuriates me
lua was literally designed to be an easy language to learn
it's also a good language (bar arrays starting at one)
with enough advanced constructs to make development quick and easy
it has everything going for it but almost no one uses it
why the fuck did python even get popular
python wasn't even designed as a programming language in the first place
I worked with someone who exported all data in char arrays and xorred ints with enums
In C#
can someone explain to me why is python and javascript the most popular and fastest growing languages? what the shit even javascript is going down but python is trhough the roof
Why is Nim so based bros?
javascript is too integrated into the modern internet to ever die
it's a cancer so much worse than the things it replaced
python is popular because it has a shitload of libraries that solve ever problem ever and a language integrated package manager
no idea how it got popular enough to get all those libraries in the first place though
so fucking bad
How the hell do people seriously code in Vim? I couldn't even save and quit
JS not cancer. It's a really nice language.
lel
Obviously not a reply, just forgot to type in 'delete'
Python is only popular because it is so easy to steal other people's code
The language itself is horrendous
my guess is that Python isn't popular as a general language, but that machine learning is popular and if you want machine learning people you ask for Python experience.
in the sysadmin world Python is "like Perl, but with a future" and Lua could be used but its regex alternative has terrible performance and the default binary can't be used for setuid scripts (it has a "run whatever this environment variable says" backdoor), and even if I'm making stuff only for root that concerns me, because someone might take a script and make it setuid without realizing the danger.
is that why there are so many languages that were designed to compile to javascript
people avoid writing it at all costs so they don't have to deal with how nice it is
Im starting a class to learn front end web development and then into some Java.
>compile
transpile
if you think about the logic of it, arrays should start at one because that is the first element of the array. C just used 0 because that first element is at an offset of 0 from the beginning.
When you are talking about offsets, start at 0.
When you are talking about items/indexes/buckets start at 0.
Personally I just always use 0 because otherwise it would just cause confusion with other programmers, and I cannot change how most languages start their indexes.
are you retarded?
Any of you guys know what this image implies? Been crawling images off google and a decent number of the downloads have been this, is it like a corrupted default jpg or what? reverse image search/googling around didn't yield anything
>use website with google maps API
>website stops working
>You have exceeded your request quota for this API.
looks like they start to bill you
fuck this
>people avoid writing it at all costs
More like at the cost of their jobs lmao
Only retarded NEETs care about langs that transpile to JS
i don't actually care about webshit but i thought typescript was decently popular
yes that's the image I posted, but what does it mean
it seems to be a placeholder/first frame for a lot of vimeo stuff, but it shows up elsewhere too (eg pinterest)
yeah they did, couple months ago iirc