/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

forum.dlang.org/post/[email protected]
twitter.com/AnonBabble

There is no better C because nobody has actually done it.
There are people that claim they have done it, but they just implemented shitty OOP lang and tried to surf on the fame of C.

C only has "fame" because it was the first of it's kind. Just like JavaScript. Neither language deserves it

There is no better C because Cniles denounce anything that is not C.

DELET THIS

Who's at Acceptance stage here?

Denied

That Dijkstra quote is misleading: he was talking about PL/I.

Can some one explain this for me?

Bargaining

cniles can't manage memory

Nobody is rewriting anything.
You can go now Steve and never come back.

dumb rust false flaggers cant' manage memory.

>Denial
I see.

cniles and sepplesfags can't grok the borrow checker

i already install codebloks ide and bluefish ,
some user told me to install vim , which it seems i did but i do not see it on the menu , which other programs should i install to learn programing ?, i will soon go to a place whit painfully slow internet and i need to download everything to learn now

Vim runs in the terminal.
Install a compiler too, I recommend clang or gcc

i already got GCC, it seems also run on terminal ,becose vim ask for it but i do not see in the menu either, any book recommendations ?

K&R (the C programming language, 2nd ed)

also how to used vim?

real programmers use variants of emacs, like Linus Torvalds. He uses umacs.

get clion uninstall codeblocks

open vim
then write
:help

>K&R (the C programming language, 2nd ed)

got it , tks user

Type vimtutor in your terminal

libgen.io

what use real learners?

sudo open vim?

unistall?
why dont you delete system 32 user it makes computers fly

Just write vim. Don't need sudo.

got it

>install vim
You are really trolled user.
Vi almost always included in every distro.
Vim almost as universal as Vi.
Most likely your distro already included Vim in their default package.

Just get EMACS. It's far more useful in the long run.

i got lxle , it seems is not installed by default

Isn't Umacs abandonware at this point? The whole appeal of Umacs in my mind seems redundant in the context of Emacs daemon. Also, Umacs only superficially resembles GNU Emacs (that is, it uses Emacs keybinds and basically no more).

This is bait.

i love jargon , but i need a program to learn , and books to follow

Why did you capitalize all the letters in Emacs?

in which sense user?

What?

i got limited time of regular internet user , i am donwloading programs and books to learn how to program , before i move to 1998 internet speed.

because EMACS is a collection of acronym

If you're OK with vim being terminal only go for vim-nox, it's the version without the graphical front-end. Otherwise take grk2 because the others are obsolete and ugly as hell

I get the second and third parts but dont understand what the calloc part has to do with the joke, am i just dense

Codeblocks provides bare minimum and doesn't really have any advantages over other IDEs. And when I tried it back in 2011 it was unstable.
The best IDE available for linux would be qt creator, consider it.
Not sure how downloading software helps you learn though. Better install eclipse just in case you will have to deal with java or python.

>Performance improvements
>** of 5% or more are commonly seen when SQLite is compiled as a single
>** translation unit.
So why isn't this done for stdlib?

An acronym? Of what? Escape-Meta-Alt-Control-Shift?

they make translation unit of every function so the linker can not include the once that are never used.

In that no one is sincerely that ignorant nor lazy except on purpose.

Editing Macros Are Cool Shit

>suggesting vim is trolling
>recommends emacs
kys senpai

Eight Megabytes And Constantly Swapping

But that's removed by dead code elimination.

I was waiting for that to be posted.

gcc ./main.c -std=c99 -I deps/ -lpthread -ldl
/tmp/ccxBdwKF.o: In function `sqlite3_libversion':
main.c:(.text+0x9a234): undefined reference to `sqlite3_version'
collect2: error: ld returned 1 exit status

What the fuck? Isn't SQLite supposed to "just werk"?

if you statically link the libc you can't remove anything from it. You would have to compile the libc for every project.

>Eight Megabytes
I wish.

you need to link it

Yes, which takes almost no time. Try compiling musl, it takes less than a second on my machine.
Link what? I'm including the sqlite amalgamation already.

it's refering to the amount of ram used, do note that it's from the time when you didn't have even 100mb of ram total.

Thanks, Captain Obvious.

>Yes, which takes almost no time.
Sure but it requires extra step when creating new project, also don't statically link the libc if you can dynamically link it.

you forgot to link it. (no -l deps/ doesn't do the trick lol)

What? If the standard practice would be to write #include instead of #include , how would it differ?

Link what? There is no dynamic library. I have a folder named deps, in which I have the header and .c file.

I know, and right now it takes 170Mb just to open a single file.

would require your distro to provide the source of libc, which isn't big thing but I think only source based distros are doing that.
that would still have the same cons as statically linking which you should not do when you can dynamically link.

whic would be the easier to use to learn?

well i need software to program , and to edit programs , i do not know much ,

eclipse , to program in java , tks i want to learn java and c++ so i will try eclipse

try adding -lsqlite3 to your gcc command

at least it isn't build on web browser.

>auto ref
Nice. Why didn't I think about it earlier?
forum.dlang.org/post/[email protected]

make sure the sqlite amalgamation gets passed before main.c into gcc. IIRC gcc can be pretty retarded with that.

gcc sqliteblah.c main.c ... -lpenis

or use clang

>mhu basic knowlege

user i am ignorant of linux , and programing jargon , i know about a lot of other stuff like videogames and books , logic and phylosophy and how to use piratebay , but i do not know about programing and programing jargon .

It's built on a shitty lisp interpreter and millions lines of legacy lisp code, I'm not sure which is worse. In a sense, emacs is everything wrong with the 80s software development approach, lisp including, too bad I'm too used to it to switch.

>and books
Do you like the tolkien lore?

>whic would be the easier to use to learn?
Same shit with different clothes. Doesn't matter.

I'm writing a Sup Forums clone with NodeJS and VueJs.

why not c variant? threads exist for such a short period of time you don't even need a database or disk space, truly anonymous

Can't I just #include it?

i have read Tolkien , but i am not a expert. i use to play d&d for the fun , not the dice and statistics.

Only for development. The headers are a separate package anyway, so they might as well include the source.

No, it doesn't have the same cons. Better performance than dynamic linking, and smaller since it's a flat file. Much better altogether.

>const reference arguments don't accept rvalues
>you have to use special syntax for it
They somehow managed to make it worse than C++98.

you need to compile the amalgamated version atleast once, to create an .so or whatever for your platform. then in future builds it should link against it. but why not use a proper command that actually builds? (compiling all your .c files.. linking against everything, the correct flags, etc)

Maybe in single file programs. Dunno if Sqlite team support it. There are also other potential issues

It actually makes sense. C++'s reference and that of D are not the same. While C++ passes the whole string object and copies it, D passes the pointer and the size.

forgot to mention, its not header-only because, well, its a pretty feature-complete sql database and is developed across sane logical boundaries then a script packages it all together.

Well I already know C, there has been a rise of NodeJS jobs in my state with new US startups coming in so I thought learning the MEAN stack would be a good investment.
Plus I wanted to tackle the issue of keeping things anonymous in a system with user accounts (my site ain't an exact copy).

This is why no one passes strings in C++ by value, you use const std::string&, which accepts both l and r-values. Why can't const refs in D just accept r-values?

also, std::string_view for new c++

It can though, but I was looking for a way to accept constant/mutable/r/lvalue all in one function. Looks like auto ref T is D's T&&.

>std::string_view
Nice to see C++ catching up with Rust's &str

Why can't I compile it at the same time as main()? But it worked if I put in sqlite3.c before main.c, instead of #include.
Like what?

It's not, std::string_view doesn't guarantee the string is alive at the time you use it, it's just a fancy name for char* + length. Can't wait for people to start using it because "Bjarne said it's fast" only to get shitton of segfaults.

what makes &str like string_view?

you can, but it has to be compiled before main just like you have to declare functions before you use them in main.., once compiled #include just brings those functions (etc) into that translation unit

>It can though
Not according to the post you've posted:
>Well, why don't you just use const then? e.g. void foo(ref const T T) {...} will accept both const and non-const arguments. They just have to be lvalues, because the parameter is ref.

You should be able to figure it out yourself.

Why can't I include the .c amalgamation file and compile it at the same time? I don't put my #include directives at th bottom, so that's a non-issue.
I don't understand. There's basically no namespace pollution, and if they wanted to support it they could rename all their internal macros to SQLITE3_ programatically while generating amalgamation.

return EXIT_SUCCESS or return 0?

That's because I mistook D's references with that of C++. They are not the same. Yes, you can pass an rvalue reference if you use templates.

Result, ma boi.

..you can?
gcc foo.c bar.c main.c
or
gcc foo.c
gcc bar.c
gcc main.c

the order shouldn't matter, but gcc is weird about it so its best to order them by their appearance/use before the entry point.

you perhaps should read a C book regarding translation units if you don't know why you need to compile source code into object files. especially why the linker exists..

So if I want to write a D function that accepts both string literals and string variables by const ref I have to use templates? Even though in C++ it's const std::string& and in Rust it's just str&?

>sepples finally gets array slices
>it's only for strings
lmao