/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

agiliq.com/blog/2009/06/generating-pseudo-random-text-with-markov-chains-u/
bazel.io
stackoverflow.com/questions/1993390/static-linking-vs-dynamic-linking
dlang.org/phobos/std_bigint.html
dlang.org/blog/2017/07/24/new-d-compiler-release-dmd-2-075-0/
twitter.com/AnonBabble

First for (((Rust)))

fist for Rust

rewriting ms paint

What's the most dudebro language?

Rate my C++ compatible C code!

int
class(new, delete, operator)
{
char *a = malloc(0);
return (new + delete) * operator;
}

fortran

your png has been optimized

get it under 30kb

> 1550x1123
> under 30kb
do you know how pixels work, son?

pajeet could do it...

Why is C++ so shit compared to rust?
>Compiling rust is just cargo build.
>Compiling C++ I have to write complicated make files and shit.
Why can't it just be simple? I want to write code. Not have to worry about a goddamn build system.

I just used arrays for the first time and you can fucking bet that I'm very proud of myself right now.

Does anybody have a good resource on writing a markov chain?
The only shit I can find are WRITE YOUR OWN DISCORD/TWITTER/IRC MARKOV BOT IN PYTHON IN FIVE EASY STEPS! and its just
>first you'll need to import this library!

Not interesting in importing somebody elses shit.

because it's antiquated shit

C++ doesn't have a standard dependency management system, the language is 30 years old

what for

Microsoft Visual Studio users don't face problems like you mentioned in your post.

agiliq.com/blog/2009/06/generating-pseudo-random-text-with-markov-chains-u/

>day
>can't write shit
>drooling in the office like a retard
>night
>productive as hell
fuck

No wonder, C++ is meant for MSVS

>import markovgen
what did I JUST say

Literally why not? No one has had time in 30 years to fix this?

>Must use propreitary software to even code in your language.

My rust workflow is literally git + vim + cargo. Why hasn't someone made a sane solution for this yet?

it has a windows problem which is arguably worse than makeshit

>Literally why not?
Lack of vision, if you look at C++ this becomes apparent

>Rust shilling this late in the day
I can't wait until Mozilla goes belly up

I can compile C++ code with literally two key presses.

bazel.io

Even >padjeet java has maven central. How is the language this far behind?

Because Rust was designed to overcome C++ shortcomings

That would be D not rust

Rust has a shittonne of warts but the build system is simple enough for me, a goddamn brainlet, to be able to use.

Nice 3rd party tool you got there

I love D, the only reason I left D is because of the STW GC

>I still have to write a makefile. Its just in our DSL.
Why?

Rust was designed for pink haired psychopaths like the transperson who cucked you to take over system programming. :^)

It's hilarious how people need their hands held to compile shit now. There's a billion build utilities for C++ and all the shills in here think cargo[cult] is somehow an exception.

rust can live just fine without mozilla at this point desu

>Rust was designed for pink haired psychopaths
Very rude

>implying makefiles don't give you flexibility much needed in an actual professional environment

>3rd party
The C++ standard doesn't specify the build system because there are literally hundreds of environments that use C++, unlike Rust. Enjoy your 100MB executables.

GC.disable();

I could spend time and learn a build system sure. But why should I have to? Building my code should be the last thing I have to worry about.

>The C++ standard doesn't specify the build system because
It has no vision
> Enjoy your 100MB executables.
Educate yourself
stackoverflow.com/questions/1993390/static-linking-vs-dynamic-linking

>No BigInt

Because unlike Rust, you don't need to implement stupid analysers just to recompile each time in C++. The first compile takes the longest and then it's just module compile and link time optimisation. It's what makes C++ faster than rust among other reasons like a much more expressive template system.

Writing a shitty encrypted one on one chat application. It works but I'm not proud of it in the slightest

dlang.org/phobos/std_bigint.html

>Sup Forumstards shit on static type checking and helpful compiler messages now because of unrelated politics
how brainwashed can you be

>2017
>Writing header files
Dropped

>creates another build system to avoid autotools
heh

Why did you waste your time learning rust? You realise Mozilla is the only thing keeping it around and Firefox will soon be dead, right?

BigInts require GC

what is it for?

personal project?

from last thread.
I'm making a site that sends requsts to a server,
then displays the result on the site.
that simple.
What should i use/do?

That doesn't explain why I need to write a make file

>bawww we have to statically link everything because of the patriarchy

Yes, Servo is the future. It's the most GPU aware web renderer to date.

It's like MPV for web browsers

>be me
>using firefox
>goto about:addons
>ublock origin detected something
>google analytics

I don't give a shit about the language. I already know it. I'm trying to learn C++ and I can't even setup a minimal build environment without booting up fucking visual studio

Is that supposed to be a counter argument?

>unrelated politics
Remove the CoC from your ass and wake up already. Rust is being artificially propped up. If this type system is such a revolution why didn't Ada take off?

Comments like these is why no one takes /dpt/ seriously

btw, new compiler out today

dlang.org/blog/2017/07/24/new-d-compiler-release-dmd-2-075-0/

I hear it finally deprecated some old string operations.

>61547408
Yeah I was just curious how hard it would be to make a socket based chat application from "scratch". The answer is not that hard, but somewhat annoying

if anyone took /dpt/ seriously, this place would be infested

thank god

Did you try reading up on gnu make? How about cmake? Pick one and invest like an hour and you'll never have to think about it again.

I have one make file that's general enough that I just need to add the necessarily library paths to, but I've since moved on to bazel. The only bad part about the latter is it needs java but adding dependencies literally takes a single line per file.

>this place would be infested
it isn't?

See

spark framework

Just read the wikipedia article, it gave me enough information to write a C# library for it.

> He thinks software is only about writing code.

Enjoy your bloated deploy.

not really

you're right, it's about meetings too

Can a program recompile itself during execution?

Is the language interpreted?

Why shouldn't it be? I'm not writing some mission critical software here. I'm just trying to build a goddamn hello world. If I needed the most minimal install I could, I would spend the extra time to fine tune it. But I don't. No one on this goddamn website runs shit that actually matters.

i don't know. do you want it to be?

if you mean JIT compilation, yes, in some languages
if you mean rewriting the file, recompiling, running the new executable, then passing stuff over to the new executable, also yes, although you need to do all that manually

during execution like Hotspot JVM, or more compiled than that?

this just a random thought in my head

imagine the performance hit

my.php

Ajax -> my.php and you're golden

It's a bad pratice. Lot of bullshit would be gladly removed from the "writing code" phase if some developers actually gave attention to another areas of software engineering. Manual build of software enables fine control of what libraries are linked, when and the flags. It's useful and necessary.

Freedom is more important than retarded abstraction everywhere to enable lazy cunts like you. So, shut up and fucking read an autotools or cmake book.

yes.

Lisp does this quite well.

Cringe
Rustc already has delta patches

Meh, I'll just program in languages that do that work for me. I'm not writing code that matters. If you want to waste your life setting up a build system for a toy project, knock yourself out.

>I'm not writing code that matters
so why the fuck are you even doing this

Fucking this. Rust babies need to stfu and let the adults in the room talk.

LOL if you think Ada has Rust's type system you are severely delusional.

Neverless it will still be hard to say where Rust wil be in a few years. It's definitely being over-hyped by Reddit and friends

>uses Sup Forums boogieman to contain discussion.
Fuck off back to your CoC enforced community

Yeah, imagine the performance hit if you could easily emit compiled code for a regular expression...

Metaprogramming is a prerequisite for performance user.

Why not? I have fun writing code. Configuring a build system isn't fun.

Sup Forums has a CoC

You browse a chinese cartoon imageboard. You're a manchild at best.

Sup Forums has a lot of Cocs

It's in the same affine family of type systems.

And yes it's being shilled to high heaven by reddit, it's hilarious they think it will make incompetent programmers compete with professionals.

It will never be adopted and it will never achieve its aims thankfully.

>>>/global/rules/

>wakeup
>there is a rust war going on dee pee tee
Fill me in, whos winning? Guys can't read autotools manual? Cargo is the shit?

you only have to write your build script once
Here's a nice simple makefile that compiles C and C++ objects into one binary
makefiles don't get much more complicated than this unless your needs are also complicated

# C/C++ mixed object makefile
CC=gcc
CFLAGS=-s -ansi -O2
DEBUG=-g -Wall -Wextra
LDFLAGS=-lm -lstdc++

SRC=src
INC=include
OBJ=obj
EXT=c cc cxx cpp c++ C
INPUT=$(wildcard $(patsubst %,$(SRC)/*.%, $(EXT)))
OBJECT=$(patsubst %,$(OBJ)/%.o, $(notdir $(basename $(INPUT))))
OUTPUT=test

.PHONY: all clean

all: $(OUTPUT)

$(OUTPUT): $(OBJECT)
$(CC) $(CFLAGS) -o $(OUTPUT) $(OBJECT) $(LDFLAGS)

$(OBJ)/%.o: $(SRC)/%.* $(wildcard $(INC)/*.h)
@mkdir -p $(OBJ)
$(CC) $(CFLAGS) $(DEBUG) -I$(INC) -o $@ -c $<
clean:
rm -rf $(OUTPUT) $(OBJ)/

C++'s build system is definitely shit. There's no doubt about that, but there are other reasons that C++ is useful. If you want to just whine, that's fine by me, but here's my CMakeLists.txt for an SFML project I'm making (speaking of things Rust doesn't have that C++ does.... SFML or a similarly pleasant graphics library)

# cmake options
cmake_minimum_required(VERSION 2.6)

# project
project(otcg)
set(otcg_VERSION_MAJ 0)
set(octg_VERSION_MIN 1)

# external libraries
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake-modules/")
find_package( SFML 2.3 REQUIRED COMPONENTS graphics window system )

# sources
set(SOURCE_PATH "${PROJECT_SOURCE_DIR}/src")
file(GLOB_RECURSE SOURCES_GLOB
"${PROJECT_SOURCE_DIR}/src/*.h"
"${PROJECT_SOURCE_DIR}/src/*.cpp")

set(SOURCES ${SOURCES_GLOB})

# compiler
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Wextra ${CMAKE_CXX_FLAGS}")

# executable
add_executable(otcg ${SOURCES})
target_link_libraries(otcg ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY})

>parameters without explicit type names
>Initializing variables without using them