/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 4a9h0dupcfq21.png (814x983, 117K)

Other urls found in this thread:

youtu.be/1HAXgM3mjSo
youtube.com/embed/msZa2EzI3zc
github.com/awesomekling/serenity
twitter.com/NSFWRedditGif

Well, that's weird. I don't want compiler to care about my health

bad OP

Attached: 1465847954964.jpg (161x110, 6K)

Rust is for men-child who can not even take care of themselves.

Cross link

Attached: 1543461490697.png (240x240, 24K)

I'm trying to figure out neural networks in case I ever need it for my job

Rust is an elaborate shitposting exercise designed to purge autistic systems programmers from the work force.
XML is not inherently bad, XSLT should die in a fire.

Attached: whut.jpg (900x1200, 196K)

Wew, Jow Forumslispmemes is like these boomers trying to look hip creating trending MEEEMS.
Also for some reason they really hate Rust. What Lisp has to do with Rust? If anything, it was killed by Python.

Attached: ud13v2qgoer21.png (1100x559, 104K)

Big if true. The problem is that Mozilla's not pretending to be retarded, they just are retarded.

Attached: kyary-burger.jpg (640x478, 50K)

>The problem is that Mozilla's not pretending to be retarded, they just are retarded.
It's likely the latter is true in most cases just by looking at everything else they're doing.

Attached: 1527604792939.jpg (453x439, 85K)

>What Lisp has to do with Rust?
One is practical, successful, and growing quickly, the other is unable to improve and will forever be just a meme.

I think they're mostly reacting to Rust and not other languages because it takes plenty of PL research ideas and actually makes them work.

learning about Zig
I have to say, it provides most I want from a language. I'm pretty impressed by both the language and its design; and how much commitment was put into it when it's not backed by being used by some group internally for their own purposes.

t. the only person to have ever programmed in, learned, or even heard of Zig

How to program them or how they work? If you use something like keras, you don't even have to understand either

>Trying to map some turing complete shit onto a markup language is a really, really bade idea.
This feels like the same concept on the other side of the fence.
If my endpoint is JSON, you're going to be taking that template, and processing it in your own language. While XML feels like you're sending instructions to the server rather than arbitrary structs. This feels like the basis of RPC, which at that point makes communicating with remote services for client developers, the equivalent of writing native language code, and letting the standard library parse it automatically.

>but you can do that with X too
But again, at a performance and modularity cost. If it's equal at worst, and better in most cases, I'm finding it hard to see why it's dropping in popularity. Meanwhile things like Electron are coming out and people are writing these markup interfaces that get translated to hell each in their own unique way instead of just having universal bridges. That complexity seems bad for developers and resource intensive on top of it.
The whole pipeline seems wildly inefficient in comparison, and ultimately more complex for client developers. imo

If Rust supported interactive development (run-time compiling + REPL) it would be almost perfect.

I really hate the edit-compile-run cycle. It's so goddamn inefficient. I really prefer the way it works in Common Lisp, where you can (re)define functions in the running program and test them immediately in the repl with all your state as it is. It's such a joy. Like it's a living organism.

Creating a new language without improving on C memory safety is just retarded, I might as well use C++17.
Also the error handling story is very bad.

I'm going to learn to code with Scheme just to spite you all.

Attached: little bullets for little problems.jpg (640x513, 91K)

I've been investigating JAI and if my understanding is correct, you could just break out to some debugger at time of bug and have the ability to parse and execute code in a way you define. So it could be interactive, you could bridge data, or whatever you wrote at compile time to happen, as an exception handler.

C does a lot of this stuff, but you rely on debuggers to do it and don't always have the best REPL experience, or specific tooling you need for your specific project.
Having it be living and extensible at random moments is very powerful. It makes me want to learn Erlang, for its ability of programs to upgrade themselves while running.

enjoy your stockholm syndrome

But I'm not a C programmer, I don't feel emotionally attached to inherently bad programming practices for sentimental reasons.

>I don't feel emotionally attached to inherently bad programming practices for sentimental reasons
>I am C++ programmer

This is why using angle brackets for generics is retarded. This is also why this "as" syntax is retarded

They're coping with the fact that they've dedicated their life to a language that earns them less, if any at all, money than something easier. Same thing Cniles do.

At least the C++ committee and the C++ community are constantly trying to improve the language and the best practices, idiomatic C++ in 2019 is quite different from 2009 or 1999. Meanwhile, the C community, exemplifying the Stockholm syndrome, is too afraid to change anything. There's this kind of natural selection, with everyone who's willing to move forward switching to C++ and, recently, Rust, so the only people left using C are conservative to a fault.

Attached: Screenshot_20190413_212053.png (548x188, 18K)

and somehow that's a reason to not say attention to new languages that do things in a different way from C++? I don't get your obsession by C.

Onee-san, I heard about this cool thing, JavaScript! Wanna try it with me?

Attached: 20170824084227098.jpg (1580x2233, 657K)

Cute~!

im about to do a bootcamp on ruby, ill report back with the amount of trannies there

creepy

trannies are just men playing woman to fill gender quotas

hello I'm dumb
developing a webapp, is it okay to put the php api scripts in public_html/api/scriptfiles.php, then call include('../../secretstuff/db.php') with connection details to the database? is there a better way to do this and am I exposing everything to the public?

Attached: 1533029436255.jpg (645x729, 88K)

the c++ committee are just watering it down to help improve market share

True, we should use Canadian Aboriginal Syllabics for it.

Attached: Screenshot_2019-04-13 r rust - Parallelizing Enjarify in Go and Rust.png (868x310, 18K)

There should be no token necessary like in ML or Haskell. Failing that, the D approach is superior.

youtu.be/1HAXgM3mjSo
wtf is this

Humor?

humor when you are bad at humor
I was quite impressed by the Moustache debugger demo youtube.com/embed/msZa2EzI3zc

what's x86 version of Load-link/Store-conditional instructions?

it's called being based

I wonder why anyone would use turtle for a 101 game programming tutorial.

It's glitchy.
It's slow.
You're probably not going to touch it again after completing the tutorial, especially when you press spacebar and your bullet just sits where you told it to spawn about 5% of the time. What's fun about toy projects that don't work as written?

Starting with a simple small static two dimensional plane with simple two dimensional characters for your very first practice project doesn't seem like a bad idea, but I have a hard time imagining that any game design module would have trouble with that.

iirc x86 use CAS and DCAS

Yeah, that was very impressive. People and developers seem to be afraid of interactive developmenmt or even "observable" programs.

as I understand it, LL/SC is an improvement on those as they avoid ABA issue.
I was expecting that x86 would have them (recently noticed ARM has them) but can't find it.

> no link to github
eh, what's the point of showing off if you're not gonna share

afaik the way you handle ABA is using a DCAS on a counter and the actual value. that way for ABA to happen the counter would have had to wrap all the way around
there's also the transactional memory stuff, but I don't know if they got that working yet

there's some papers out there on how to implement LL/SC with CAS and vice-versa

i need a job badly, ill do it for one

Attached: chun.png (252x352, 147K)

well here goes the answer to what am I doing this weekend

I'd like to DCAS your mom.

There are much better job opportunities than programming if you're willing to explore the forbidden anyway.

go on

Why won't my sc.nextLine() Scanner variable run?

Attached: OAP code.jpg (1586x749, 91K)

my guess would be that there was a trailing \n symbol after .nextDouble() and it fulfilled the .nextLine() call, try to insert something on previous input and see if it appeared on .nextLine()

there are some debugger projects on Handmade Network, I wonder if some provides similar features

Onee-san, I heard about this cool thing, JavaScript! Wanna try it with me?

Attached: javascript rocks.png (1000x494, 134K)

Being a trans sex worker, for starters. People are gonna pay you money to suck off your cute feminine dick, which is much better than sitting 10 hours a day in an office writing some obscure code no one will ever run. You can still contribute to open source in your free time if you're interested in programming.

Attached: Fj+irl_3dc06e_6177465.jpg (900x545, 54K)

jesus christ fuck off tranny

Attached: shush.jpg (950x1352, 236K)

I think I'm going to need a 3-star pointer in my code.
It's a pointer to an array of int pointers.

Attached: 1548897321647.png (489x424, 129K)

Actually, false alarm. I can get the max size up front and just leave it over-allocated.

Girls with dicks make the best programmers once they're wearing programming socks.

Attached: asfhwb92i7q21.jpg (1024x753, 135K)

good to hear

Attached: 1532961476356.jpg (1280x720, 572K)

nyankos a cute

>[string].equals("...")
Poos will defend this

>a programming language is just a tool

Fastest way to spot a brainlet who only codes python

Making a minesweeper game for my operating system. Someone pointed out that I need some desktop games for that proper mid-90s feel, and it totally fits.

Attached: Screenshot at 2019-04-13 15-39-38.png (1920x1080, 975K)

Trying to automate a currency arbitrage system that would capture the price spread when price discrepancy occurs.

Attached: fx.png (1208x661, 620K)

Love that aesthetic.

you should use anime girls for the faces

Attached: 1549183018208.jpg (692x913, 79K)

you should use anime girls for the mines and numbers

a whole week and I've only read 20 or so pages of this book

Attached: 1447854695276.jpg (600x322, 43K)

I need data to piss about with in azure.

What's the best free API's out there?

Thanks user :)

I'm gonna stay out of the copyright swamp, but maybe I could make it user-themable!

How is the UI implemented in the kernel? Is it similar to Win32? Does the OS have logging like dmesg or logcat?

I do indeed have a kernel log buffer (which can be dumped with /bin/dmesg)
The UI is implemented outside of the kernel. It's similar to X11 with a client/server architecture with a WindowServer process composing the window stack into the display framebuffer.
GUI clients talk to the WindowServer through a local socket and double-buffered SHM bitmaps are used for the window backing stores.
The kernel is unaware of any of this, all it does is just facilitate memory-mapping of the graphics memory and IPC+SHM between server/client.
The GUI API's that I end up using to write most of the programs are a userspace library called LibGUI, which works very similarly to Qt.
You can find sources for everything if you're curious to look around :)
github.com/awesomekling/serenity

Source?

20 more than me

why no one on Jow Forums talk about mobile programming?
also how do you guys stick to one thing or keep learning? there are million of technologies thousand of alternatives and branching fields. there is a possibility that the thing you are learning is either over flooded in market or no one care about it.

>why no one on Jow Forums talk about mobile programming?
Because it's extremely shitty and nobody wants to do it. You're always forced into the shittiest tooling as well when doing that shit, which makes it even more of a pain in the ass to get started.
>there is a possibility that the thing you are learning is either over flooded in market or no one care about it
I've specialised hard, and even managed to get a job doing it. That's not a problem for me anymore.
But even then, I just did what I did because I wanted to use the program I was writing. Getting a job at the end was just a bonus.

so concrete and straight forward,
also is learning a skill or thing without any order a bad idea, like not having that much edge in data structures and jumping on other things like external libraries, and only learning them when needed a bad idea?
i do know about data structures and used them but didnt know how and why stuff like map and trees were used for, and now i am thinking there maybe much more i could be missing.

I'm a haskell noob, but I have managed to write the program to do what I want. I can manually call the function I wrote and it will print the correct output.

How do I convert this imperative code to haskell?

int input;
input

I think most people here either like Scheme or are indifferent about it. Anti-lisp posters can be safely ignored.

>It's another thread not syncing properly problem
Fucking J U S T my shit up famalam

As somebody new, you don't know what you don't know. You'll get better over time; just keep programming more shit and researching whatever you end up thinking is interesting.
The main way I got most of my experience was to set a really fucking difficult goal (not knowing how difficult when I wanted to do it). There was a certain type of program I wanted to write/use, and I spent literally years of casual research to learn how to do it.

Any real implementation of LL/SC is only suitable for implementing atomic RMW operations, anyway, because of hard limitations on what you can do in between and spurious failures. The proper way to avoid ABA is to not free memory while another thread has a pointer to it, using garbage collection or hazard pointers or something like that.

TSX has the same issues as LL/SC, and is only usable as a potential fast path for existing synchronization techniques (e.g. lock elision, teleportation).

i kinda did similar but i set my goal very small and wanted to make a simple android wiki like fanapp about a game. but now that its done i am lost and also saw that its extremely simple and not all that much of an achievement but the main problem that is making me question these things is that almost all it market in our country consist of web and things related to it,
but still thanks user, it was good glimpse how professionals with jobs think

static const char refs[] = { '0', '7', 'W' };

int hex2int(const char *str)
{
char c;
int n;
n = 0;
for (c = *str; c != '\0'; c = *++str) {
n = 16 * n + c - refs[c / 32 - 1];
}
return n;
}

Make sure your 4chanX settings aren't fucked if it doesn't update threads.

>The proper way to avoid ABA is to not free memory while another thread has a pointer to it
I hope you know you wrote a bullshit

I'm talking about c++ thread my dude

I'm trying to print excel sheets to PDF but using the built-in M$ PDF printer gives me a dialog box. I don't want to open the sheet and print line by line because that's the pajeet way of doing it.

That's what the ABA problem stems from. Name one (1) counter example.

> can't write 5 lines without introducing a memory access bug
Programming in C should be a bannable offense, all Cniles should be sent to re-educational camps.

>> can't write 5 lines without introducing a memory access bug
Where? I test that code.

Holy shit that's the book I'm using in one of my classes.

Oooh. That's what I was missing. I was thinking "Man if only there were some way I could just *place* the "&args" argument", but it never occurred to me to use macros.
Thanks user!

Attached: Screen Shot 2019-04-13 at 7.57.57 AM.png (1808x1356, 322K)

Jow Forumsizen in riverdale on e-hentai

Attached: omg.png (967x794, 1.23M)

Projecting your own shortcomings onto everyone else isn't healthy, user.

A char can have values outside 0..127, either in the negative or up to 255. In either case, there's an out-of-bounds access of ref. Also when char is 0..31, you're accessing ref[-1]. But there's no need to blame yourself, your code is about as safe as a typical C code, it's basically impossible to write good code in it. You should blame yourself for using C tho.

yes that's literally what it stems for
so how are you expected to avoid it? if the answer was simple it would not be a problem
1) never share data between threads
2) never free data
those are the only ways fulfill your advice