[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 2.17 MB, 1164x1738, code_master.png [View same] [iqdb] [saucenao] [google] [report]
66886476 No.66886476 [Reply] [Original] [archived.moe] [rbt]

Cute girl edition

Previous: >>66877528

What are you working on /g/?

>> No.66886497

learning vulkan

>> No.66886504

how come userland network stack can be faster than kernel

>> No.66886509
File: 51 KB, 1280x800, 2018-07-25-212709_1280x800_scrot.png [View same] [iqdb] [saucenao] [google] [report]

Remembering how to use SDL2.

>> No.66886514

>What are you working on /g/?

>> No.66886519

Why tf would you write in Lisp

>> No.66886531

>writing some shell clusterfuck when I can make a C# program that never crashes instead

>> No.66886534

emacs configurations

>> No.66886542

So autism?

>> No.66886544

To be mysterious and esoteric
It aligns well with the goals of occult programmers

>> No.66886549

btw writing a >5 line script in pure bash because i thought it would be faster than using python or something (inb4 use c/go) for control flow

>> No.66886563

networking in whatever you're using(probably linux) is a straight hack, and whatever userland hack you're using has less features and is therefore faster.

>> No.66886583

ML family is the greatest langauges of all time.

>> No.66886592
File: 22 KB, 800x500, 2018-07-25-174057_800x500_scrot.png [View same] [iqdb] [saucenao] [google] [report]

I'm working through this libtcod tutorial using Python


Getting close to the end of the tutorial, I'm on part 11. So far I've only deviated by adding some extra properties to my entities and map rooms and redoing the menu system. Once done with the tutorial I'm going to rework the game in to a scifi roguelike.

>> No.66886606

i wanna fug iori

>> No.66886610

Slower than C, yet no faster to write. kys

>> No.66886612

hi bobby

>> No.66886657

But it looks pretty and is much easier to read therefor it is better.

>> No.66886668

Proof? Just use Rust if you want the same speed as C with the power of ML.

>> No.66886701
File: 787 KB, 260x195, PLipXAZ.gif [View same] [iqdb] [saucenao] [google] [report]

Does anyone else not see the point in writing more software?

There are very few occasions at this point where I find a problem and thing "I should write an application to solve this."

Building new solutions from the ground up for solved problems just seems so pointless, but then I look at my near barren github and think that maybe I should start cranking out shit just for the sake of it.

>> No.66886729

>solved problems
I'll usually write something from scratch because something the existing solution does is retarded, or so that I can add network functionality and control it remotely.

>> No.66886744

iktf. Do the autists who obsessively program for 10+ hours every day just reinvent the wheel?

>> No.66886746

Working on a Draw Poker game in Visual C#. Just for fun. Also I love Visual Studio and own 100 shares in Microsoft.

>> No.66886755

this is reasonable. but most of the time whatever i'm using is open source so i can just modify it to do what i want, or worse case scenario write a wrapper to add whatever functionality I need.

it's starting to seem that way. there's too much shit code out there as is, they need to stop.

>> No.66886909

I think it is because programmers think it is easier to rewrite code from scratch than to fix code which already exists.

>> No.66886938

I reinvent the wheel because programming is mostly a hobby and wtf else am I supposed to do? I only really know Python and the open source software I use is generally massive programs written in C or C++ and I have no hope of contributing there.

>> No.66886998

I mean, let's say you like playing Othello. It's been done hundreds of thousands of times before but that doesn't mean you can't have fun doing it yourself. It won't be better than the other ones but it'll be yours. Same reason amateurs do art or music for fun.

>> No.66887012

Why aren't you using one of Haskell, PureScript, Idris, and Agda?

>> No.66887018

python or javascript with nodejs? what should I learn to create bots/scrapers/automate stuff + websites.

>> No.66887032

Because I'm not autistic and I like to write efficient code. White men write efficient code, (((they))) write abstract functional code

>> No.66887040

just give up dude
leave programming to people who actually do have ideas

>> No.66887048

Development time is more expensive than execution time for most software.

>> No.66887049

Working on some Crystal libraries

>> No.66887059

nobody on /g/ will ever understand this

>> No.66887060

Because I use Scheme daily at work and haven't learned Haskell yet

>> No.66887069

It has no libraries

>> No.66887102

Haskell has many high-quality libraries

Using Scheme is not a sin but a penance

>> No.66887121

Show me which ones that are actually high-quality and actively maintained?

>> No.66887130

it's cute and round

>> No.66887163

Cross compiling Haskell is a joke.

>> No.66887165


>> No.66887169

Not that anon but anything that Haskell excels at. Look at any lexing or parsing lib and it should be pretty good.

>> No.66887177

lol, those are rookies numbers.

>> No.66887186

Are you judging somethings quality solely based on how many people use it?

>> No.66887203

I think he might be. The Java argument in action.

>> No.66887214

Created a free lynda.com account and downloaded a ton of videos with a python script.

>> No.66887371

Does anyone use Qt with c++ on Windows? I built an app, but when I ship it the checkboxes are not displayed on some systems.

>> No.66887462

is lynda.com actually good?

>> No.66887490

I've heard their RE tutorials vary in quality but specifics are good.

Currently I'm adding bezzier curves to my aimbot to prevent straight line movements.

>> No.66887514

I think it's decent, depends on the course. I don't only watch programming vids, but also things like design. Photoshop and Illustrator tutorials are vety good.

>> No.66887565

Anybody done webassembly stuff?
I want to make some js lib go faster but not sure if I should somehow represent and pass js objects in webassembly code(rust/c) or just map them to numbers and use those in the webasm

>> No.66887671

>Remembering how to use SDL2.
Use sdl gpu

>> No.66887684

I write fortran.

>> No.66887761
File: 86 KB, 1366x768, my.png [View same] [iqdb] [saucenao] [google] [report]

Plotted activity of the last thread.

>> No.66887786

holy shit, this looks great

>> No.66887908 [DELETED] 

am i fucking retarded, whats a better way to do this

// get the first episode in any consecutive chain of episodes, e.g. [(1),2,3,(5),(16),17,(32),33]
var episodes = result?.Select(item => item.Episode)
.Distinct().OrderBy(i => i)
.Aggregate(new List<List<int>>(), (list, i) =>
if (list.Count == 0)
list.Add(new List<int> {i});
else if (list.Last().Last() + 1 != i)
list.Add(new List<int> {i});
return list;
}).Select(i => i.First());

>> No.66887917

am i fucking retarded, whats a better way to do this, now with not a bunch of random spaces

// get the first episode in any consecutive chain of episodes, e.g. [(1),2,3,(5),(16),17,(32),33]
var episodes = result?.Select(item => item.Episode)
.Distinct().OrderBy(i => i)
.Aggregate(new List<List<int>>(), (list, i) =>
if (list.Count == 0)
list.Add(new List<int> {i});
else if (list.Last().Last() + 1 != i)
list.Add(new List<int> {i});
return list;
}).Select(i => i.First());

>> No.66887918

Not using Javascript

>> No.66887927

alright i've got that step down since its c#, whats the next

>> No.66887933

now repost again but this time without using var

>> No.66887940

Not using C#

>> No.66887942

its an IEnumerable<int>

>> No.66887954

Will look into that. Thanks!

>> No.66888028
File: 28 KB, 186x208, 1517003239319.png [View same] [iqdb] [saucenao] [google] [report]

Why threads are so confusing

>> No.66888050

how are they confzsing

>> No.66888094

Which is better: Rust or C?

>> No.66888103


>> No.66888114


>> No.66888122


>> No.66888126

static IEnumerable<int> FirstEpisodes(IEnumerable<Item> items) {
var ordered = items.Select(i => i.Episode).Distinct().OrderBy(e => e);

return ordered.Where((e, n) => {
if(n == 0) {
return true;

if(ordered.ElementAt(n - 1) != e - 1) {
return true;

return false;

>> No.66888139

Only you can answer that, anon. Look into your heart.

>> No.66888147


>> No.66888163


>> No.66888173


looks cool

>> No.66888177

>https://www.idris-lang.org is down
update soon lads

>> No.66888196

>types could have prevented thi-

>> No.66888208
File: 554 KB, 918x680, Karakai Jouzu no Takagi-san - Ch.80 - Counting Steps - 2.png [View same] [iqdb] [saucenao] [google] [report]

what language do I use for my simple puzzle game and neural network

>> No.66888214

How do I defeat object oriented programming?

>> No.66888217

iori is for anal!

>> No.66888220

by adopting FP, its mortal chad enemy.

>> No.66888222

Is it bad I unironically prefer Standard ML?
I feel it has less bullshit. It's the Scheme of ML family.

>> No.66888229

you don't follow the OOP practice

>> No.66888243

oop is just fp but with boilerplatey syntax

>> No.66888256

quick someone give me some short assignment i am bored at work

>> No.66888258

I know you're not serious, but this is an incredibly stupid statement.

>> No.66888262
File: 61 KB, 198x194, yy2.png [View same] [iqdb] [saucenao] [google] [report]


>> No.66888269

draw a simple house in ascii with just programming, and absolutely no hard coding.

>> No.66888347

persistent red black trees make me want to fucking kill myself

>> No.66888361

the fuck does that even mean

>> No.66888373

you'll need somewhere to live
programming won't pay the rent

>> No.66888379


>> No.66888411

bot moh employeer wonts c++

>> No.66888413

Suggest 4chan JSON analyzer commands.
>freq t
Computes how many posts were posted in t seconds interval
Output average post frequency per hour, average unique ip frequence per hour and average image frequency per hour
outputs post no and time side by side

>> No.66888440

c++ can be anything you want.

>> No.66888557

can it be my gf?

>> No.66888585

top country posts by board.

>> No.66888598
File: 63 KB, 1280x800, 2018-07-26-013140_1280x800_scrot.png [View same] [iqdb] [saucenao] [google] [report]

Well I managed to translate all the rendering stuff to sdl2_gpu, and the movement seems more smooth now. Thanks again!

>> No.66888608

Just write a siri

>> No.66888637

What a coincedence! I'm going through lazy foo's tutorials, but I'll be using makefiles because Code::Blocks has been annoying and I should learned makefiles (I'm used to not using an IDE professionally).

Epsilon uses a scheme dialect, and it's probably the most interesting text editor I've seen (it doesn't work that great on linux tho)

>bash is bad
Wait til you see batch. You're using ${var} right?

If you spend the time to learn Perl, you can make your own basic system libs and stuff. I don't have the same job anymore, but I wrote a library to load options files (it can even load them into arrays and hashes directly). It's not the safest, since it actually builds a perl script, runs it, and captures the result. It works fantastically though.

Find new problems to solve. I want to write a PLL logic simulator or a simulator for CMSS software so I can learn it for a job. I also want to write an audio-output based wave generator, for transcranial direct-current stimulation. That's not hard (I've done it before by creating wav files, I should do it live with SDL or something).

>good C code
>take 3-6 months to learn by even a mongrel
>can follow good code and remember language easily
>good functional code
>have to learn whatever meme it is for six months (not counting the two years spent on comp sci classes)
>every time it's going to be some shit that wraps a library and does nonsense with it, because each language decides to have it's own math memes that have to fall back on C because reality isn't pure math
I've been told repeatedly, Computer Scientists make worse programmers than Electrical Engineers, for many reasons.

Whatever these are in (C and libraries):

>> No.66888676

>writing a library
>day 1
>"gotta have this feature and that feature, better add an option for this and whatnot"
>implement everything, works fine
>getting close to completion, can release it soon
>"fuck your features, fuck your options, everything goes out the door, less code is better, we're keeping it minimal now"

and it feels so good

>> No.66888791
File: 49 KB, 604x453, 1520309255805.jpg [View same] [iqdb] [saucenao] [google] [report]

When you realize that 'monad' is another name for an object and funcfags are using OOP every day while being too dense to notice...

>> No.66888803


>> No.66888836

mw:~/4chan# curl https://a.4cdn.org/int/thread/92713120.json 2>/dev/null | ./4chan.lua country | sort -n -k 2 | tac
NL 266
BE 14
SE 2
FR 1
BR 1

>> No.66888881

now make a pretty front-end with graphs.

>> No.66888914

Not interested.
Please post more command suggestions.

>> No.66888926

That was close

>> No.66889075

>I've been told repeatedly, Computer Scientists make worse programmers than Electrical Engineers, for many reasons.
I don't know about you, but I've seen code written by EEs. I'm not talking about math-heavy or bit-fiddling-heavy, because those are bound to be complex. Just a normal code for a desktop application they decided to whip up to test some hardware. If I said it was "fuckawful", that would be a compliment. We had to integrate it to the main application. And it was just 2k lines of C. And I've seen that trend many times. Other types of engineers (who learned how to program themselves, not because they were forced to) are generally much better. There's a literal rocket scientist sitting near me, and he's one of the best developers I've seen.

>> No.66889144

>tfw boss walks in unexpected
>thought he would be gone for several hours
>tfw quickly ctr + a directory with code files and press enter
>ide opens just as he walks into the viewing angle of the monitor, at the exact nanosecond
holy shit that was too fucking close
i cant take this kind of stress

>> No.66889149

what were you doing...

>> No.66889155

get number of code tag posts in a /g/ thread.
get the currently trending anime on /a/ according to keywords.
same with /v/ for vidya and a ton of other boards.

>> No.66889234

Jai is the future

>> No.66889239

depends how the final syntax looks really.
it's crossing into rust-tier at times, but jblow said they're gonna change most of it.

>> No.66889293

From what I've seen its metaprogramming can make C++'s template hell look like a kindergarten. It is, though, much more comprehensive, and I like the idea of specifying the build in the language itself.

>> No.66889352

From what I understand, the C++ generic programming feature of templates is used for metaprogramming because it allows this almost by accident. Template metaprogramming wasn't fully intended to be a thing but it just arose out of the design of templates being instantiated by the compiler for all different types they are used with. Jai is more mindful about this because Generic programming using the $ syntax is deliberately separate from compile-time metaprogramming.

>> No.66889370

Does Jai allow embed file into source automatically at compile time?

>> No.66889377

pretty sure jai has some form of mixins, i could be wrong though.

>> No.66889436

WPF or UWP? Sort that log shit with columns and change is2.4chan to i.4cdn
It is much faster

>> No.66889540

Who thought it was a good idea to put backspace next to the enter button

>> No.66889572

get a decent keyboard.

>> No.66889697

Browsing this genetic cesspool instead of working

>> No.66889704

Should data types have truthiness? Like everything is true except void is false

>> No.66889706

>tfw slowly turning into an FOSS evangelic
still on windows tho lmao

>> No.66889711

trash language
try again

>> No.66889715

You gonna post the cute girl yet?

>> No.66889723

just install debian
or ubuntu if you want windows baby-mode.

>> No.66889757

what language does not have void?

>> No.66889766

possibly. i need to do an inventory or something on what i really use windows for

>> No.66889767

in the sense non FP langs use them, most FPLs.

>> No.66889778

Languages which have a superior unit or 0-tuple type.

>> No.66889795

the only real thing linux can't do for the average person is 100% game compatibility. But if you don't play any that use Easy Anti Cheat. Wine can run most likely run them fine if a linux version isn't available.
there's also https://lutris.net which does all the wine work for you.

>> No.66889808

It is still present in Haskell for instance, and quite important for the algebraic properties of ADT.
This is not the same thing. Either Void a ~ a, but Either () a !~ a.

>> No.66889819

and anal is for closet faggots

>> No.66889837

eh void in haskell is a little different.

>> No.66889847

You're right, but void in C derivatives (i.e. the void that most people are talking about) resembles a unit type more than an empty type.

>> No.66889860

>get number of code tag posts in a /g/ thread.
I don't see the point.
>get the currently trending anime on /a/ according to keywords.
>same with /v/ for vidya and a ton of other boards.
mw:~/4chan# curl https://a.4cdn.org/g/thread/66884410.json 2>/dev/null | ./4chan.lua match patterns
[nN][vV][iI][dD][iI][aA] 4
[aA][mM][dD] 11
[iI][nN][tT][eE][lL] 14

Lua pattern matching sucks a bit (but for good reasons), but it's enough for most queries.


>> No.66889920

just install a regex lib

>> No.66889928

I know, but that can be done later.

>> No.66889958

>allocate memory
>do read syscall into allocated memory, kernel memory checks succeed (no EFAULT).
>while read syscall is blocked, deallocate the memory from another thread
>data becomes available, kernel reads it and copies it into (now deallocated) buffer
>pagefault in kernel -> kernel panic
So, how does the kernel prevent this?

I'm thinking temporary kernel space buffer, but that comes with it's own problems.

>> No.66889994

any oracle wizard here ?

I got a unix script that import a CSV file into a table via a sql loader script.
Once finished, it starts a trigger. In this PL/SQL trigger, I have an insert into that doesn't work when launched with the trigger, but that works if I use the run the query manually.
Why is it doing that ?

I have tried this in two different scripts that does approximatively the same job. One tells me "invalid number", the other one don't understand the date format (even with the date conversion.

>> No.66890027

honestly can't think of any more beyond experimental stuff like parsing shitposts and sorting it by country/time zones/ per board/highest/lowest shitpost rate per board per time of day.
but 'shitposting' is a tedious thing to parse because of the human context.
just get a new project.

>> No.66890037

samefag detection

>> No.66890045


>> No.66890061

in this day and age?

>> No.66890067

with the data provided by 4chan, yeah

>> No.66890078

hopping IPs and clearing cookies is trivial.

>> No.66890079
File: 52 KB, 640x495, 1530811044624.jpg [View same] [iqdb] [saucenao] [google] [report]

CS student here who lives in a shitty small college town. How often do companies pay for relocation when hiring?

>> No.66890087

if a person can a computer should be able to as well

>> No.66890100

Can a computer die?

>> No.66890104


>> No.66890117

What should I do? learn data structures or try to create useful programs?

>> No.66890128

your velcome

>> No.66890130

yeah no graph

>> No.66890138

Go and C are brainlet languages

>> No.66890159


>> No.66890161

What c++ widget toolset would you recommend /g/.
It being free would be welcome else I think you'd advise Qt, right? I considered it too but there seem to be a lot of fuckery around the "free" licensing.

It's for small program btw, and hoping to make a few bucks too maybe.

>> No.66890165


>> No.66890168

just use sfml.

>> No.66890176

there's no fuckery around the licensing, all it means that if you're going to redistribute/sell your Qt application, you have to link Qt dynamically, that's all there is to the free license

>> No.66890188

Guys. I want to ask if something is okay. But it's more like i'm asking permission to do this, when i know i could do it if i damn well wanted to. But i still think i really shouldn't be doing this.

And i have tried looking up this question through google. I wouldn't be asking actual people if i could help it.

Is it okay to make an instance of a class global?


SomeClass theClass

int main(){

//do stuff to and with theClass

return 0;

I'm reading a tutorial which does this, and it would make things shit loads easier in certain circumstances. But i also feel like it's violating some massive sacred rule, to avoid global variables, and i keep avoiding it like a dark magic.

So is that okay? Is that a common thing in big professional programs, that there are some objects which are global?

>> No.66890203

globals are evil but sometimes they're the least evil option

>> No.66890215


Yes, that was one of the answers i found looking it up on google. But if knew that big professional programs had some global classes, i'd feel like i'm not being lazy.

Like, if fuckin' photoshop has 1 or a few global classes.

>> No.66890231

please stop reddit spacing.

>> No.66890235


What is reddit spacing?

>> No.66890250

formatting your




instead of this
this if you really have to.

>> No.66890256

They probably use singletons instead. Same shit but slightly easier to refactor.

>> No.66890279


They're just a space between paragraphs. It looks fine in the quick reply text box.


>> No.66890323

fucking uploading a picture to another website when you're on an imageboard
absolute fucking reddit

>> No.66890332


I've heard of singletons. I don't know them well, but if i understand them correctly, they are just a class where you try to make sure you only ever have 1 instance of the class.

But that doesn't do anything to help or justify the global variable issue does it? Almost all the reasons global variables are evil, a singleton would be evil too, wouldn't it?

So are singletons consider acceptable global variables in real projects? And by extension if i used a global variable like a singleton, would it constitute (possibly) the professional way to do it?

>> No.66890348

>Need to script something
>Roll some python
>Remember I don't have an IDE with autocomplete for it
>Wonder if such a thing exists since the language is dynamic

>> No.66890350


It's a screen cap program. I hit the printscreen button, and i press another button, and it immediately uploads to that site and spits out a URL. It's faster than saving it, and opening the files button on 4chan. For the love of jesus. Shut up about goddamn reddit.

>> No.66890365

>It's faster than saving it, and opening the files button on 4chan. For the love of jesus. Shut up about goddamn reddit.
you don't have to do either, you can upload to 4chan directly from the clipboard you redditor

>> No.66890367

>python auto-complete
literally any ide and TE

>> No.66890375
File: 90 KB, 619x701, file.png [View same] [iqdb] [saucenao] [google] [report]



Huhn. I never knew about that function.

>> No.66890385

you just press ctrl+v and if you have a picture in the clipboard it will start a new post with that picture, assuming you're not using vanilla js if you're not a redditor

>> No.66890388
File: 5 KB, 279x81, 1531543311907.png [View same] [iqdb] [saucenao] [google] [report]

Of course.

>> No.66890411


I just did it. Anyway, back to the topic at hand and away from your 12 year old territorial website rivalry bullshit.

Are singletons, or using classes like singletons as global variables something you'd find in professional programs? Or am i just being lazy/ignorant to do it?

>> No.66890427

>I've heard of singletons. I don't know them well, but if i understand them correctly, they are just a class where you try to make sure you only ever have 1 instance of the class.
That's basically it, yeah.

>But that doesn't do anything to help or justify the global variable issue does it? Almost all the reasons global variables are evil, a singleton would be evil too, wouldn't it?
Singletons are evil for most of the reasons globals are, but there are a handful of benefits. Ensuring only one instance of the object using a private constructor can is probably closer to what you want for example.

>So are singletons consider acceptable global variables in real projects? And by extension if i used a global variable like a singleton, would it constitute (possibly) the professional way to do it?
You see it a lot in "enterprise" code. It's slightly better but usually used as a hack to get globals in a language that doesn't have globals.

My advice? Try to see if you can use a static variable at function scope. If you need to use it in more than one location, pass a pointer or reference to it as an argument. If that doesn't work then you can try a global but try to limit the amount of time you use it directly.

>> No.66890437

they're fine as long as there's no other option in the context of what you're doing

>> No.66890536

>the “naked ladies” section
oh my

>> No.66890732

anyone have enough spare time to make gcc better than llvm again?

>> No.66890798
File: 10 KB, 480x360, hqdefault.jpg [View same] [iqdb] [saucenao] [google] [report]

>check competitors
>average business software
>one of the competitors is only distinguished by a fancy GUI
>NodeJS shit that takes a week or two of extensive work to make
>check product's income and profits
>billions of dollars

Redpill me on this.

>> No.66890818

Tried a few and they all failed.

>> No.66890830

your shit was probably configured wrong. but uninstall python regardless.

>> No.66890866
File: 456 KB, 1000x1000, 1525988851075.png [View same] [iqdb] [saucenao] [google] [report]

Is Go a good choice for a non trivial UI bound desktop application? By non trivial I mean like a word processor or spreadsheet manager.

>> No.66890868

momentum, herd mentality, first mover advantage, those sorts of things

>> No.66890936

>NodeJS shit that takes a week or two of extensive work to make
Non-programmers do not care about what technology their product is made in.
Programmers don't like javascript partly because it's a pain to work in, which no end users notice, and because things like electron take a lot of resources, which most end users don't notice.

>> No.66890938


>> No.66890940

No. C++, C# and electron (best -> worst) are your best bet.

>> No.66890964

Is there a book or something that helps you get started with creating web servers? I'm not sure where to start, everyone's talking about Docker and then there's a bunch of frameworks and it just goes on with names and technologies and god knows what.

>> No.66890976

>everyone's talking about Docker and then there's a bunch of frameworks and it just goes on with names and technologies and god knows what.
Software development is rotten

>> No.66890994

unironically learn Go, it's made for backend webshit.

>> No.66891014

I suggest Elixir/Erlang. It is almost unmatched in telecommunications,

>> No.66891029

Why does the compiler give me an conflicting declaration 'void* Chip8Table [17] error?
#include <iostream>

#include <stdio.h>

unsigned short opcode;
unsigned short PC;
void (*Chip8Table[17])();
void (*Chip8Arithmetic[16])();

void fetch()
PC += 2;

void execute()

void cpuNULL()
// Do Nothing

void cpuARITHMETIC(){

void (*Chip8Table[17]) =
cpuNULL , cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL,
cpuARITHMETIC, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL,

void ((*)Chip8Arithmetic[16]) =
cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL,
cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL, cpuNULL

int main()
return 0;

>> No.66891041


>> No.66891053

I will look into these. Thanks.

>> No.66891062

Because you declared it incorrectly. First you declared it as a void(*[17])() and then you declared it as a void*[17].

>> No.66891068

if you want Erlang, you'll most likely want to use its little brother Elixir which is made for web shit.
Elixir or Go are fine though.

>> No.66891093

I was actually planning on learning Elixir in a while, but right now I don't have the time. I was hoping for something that I could learn in a day or so but it seems like that path is just one of pain and frustration.

>> No.66891110

Is this even a valid type?

>> No.66891132


>> No.66891141

Yes. Array of pointers to functions that take unspecified arguments and return void.

>> No.66891142

The principles of OOP are:
(i) Inheritance
(ii) Polymorphism
(iii) Abstraction
(iv) Encapsulation

Most functional languages support programming according to each of these principles. The divide between OOP and Functional is artificial. The real spectrum is between imperative and declarative.

>> No.66891175

based c

>> No.66891191
File: 100 KB, 320x320, 1506460579665.png [View same] [iqdb] [saucenao] [google] [report]

If I have a function that I'm passing enum classes to but all the enums I'm using are basically just a number of the choice the user is making should I have that argument use a template or should I just static cast the enums to an int before passing to the function?

>> No.66891196
File: 144 KB, 1700x1020, DY8U45AUMAA4nkh.jpg [View same] [iqdb] [saucenao] [google] [report]

Everyone said not to make an MMO as my first project so I took that as a challenge.

The target is a scalable, seamless, open-world MMO. The technology is working but with dozens, possibly hundreds of yet untested edge case scenarios and very few user-facing features. I'm implementing a debug mode to alert me of client/server inconsistencies.

Graphical content is good, but not my work, getting improved consistently. UI is bare. Networking is efficient and latency is minimal. The payloads are robust, small, and easy to parse. A balance between smoothness and latency is difficult.

Load balancing and offloading via server division by region is fluctuating between a non-automated working state and an inoperable, non-scalable state. I haven't yet come up with the solution for region logic that I'm satisfied with, but some of my attempts have been acceptable.

Database and database access is in a complete working state. Authentication of clients with hashed passwords and temporary one-time-use authentication keys is in a complete working state.

Currently theorycrafting more elegant solutions to inter-region interaction as I move onto my second refactoring, where I split the generic server into different projects (region logic, C&C, client front-end, chat, trade).

Current project split is client, generic "server", login server, database.

>> No.66891211

Go will most likely be the fastest.
but elixir + phoenix is the better solution.
Or you could do
Elm + Phoenix if you want a little more FP.

>> No.66891220

>should I have that argument use a template

>> No.66891235

wow solved mmos

>> No.66891245

How does this pattern identification work? Did you supply keywords or did it detect them?

>> No.66891252

fp is just oop for people who don't have jobs

>> No.66891256

they are in file named 'patterns'

>> No.66891263

Just a friendly reminder.

>> No.66891299
File: 614 KB, 1920x1108, 1523286819163.png [View same] [iqdb] [saucenao] [google] [report]

>I'm a white man, I wrote my own compiler. I'm not a nigger like Linus

>> No.66891316

Very much this. Even C++ is "functional" and so is Java (in an autistic way).
The thing is that the market and generally most programmers with jobs prefer algol-like imperative syntax with functional features over the impractical declarative crap with OO.
Declarativefags are so fucking religious about it but that will never change the fact that the most popular declarative PL is the forced VB.NET garbage. KEK

>> No.66891328

I think I will enjoy writing Elixir much more than I will writing Go, so that's what's deciding it.

>> No.66891344

by that definition, you can call JS functional.
i love when Poojeets shit on FP, but try desperately to cling to a delusional rationalization that they can do it too.
Have fun writing pure C++ with UFCS.

>> No.66891384

What makes a language functional?

>> No.66891395

can someone help me with java?
public interface IFoo<T> {
void foo(T arg);

//do i have to specify the type between angle brackets?
IFoo<bar> baz;
IFoo baz; //is this ok?

>> No.66891417

But you can do this.
IFoo<bar> baz = new IFoo<>();
And if you update to a recent version of Java you can do this.
var baz = new IFoo<bar>();

also we don't do IFoo in Javaland. That's a C# thing. Just call it Foo.

>> No.66891424

purity, totality checking, UFCS or piping, first class types, and elegant looking code are the basics.

>> No.66891448

also i forgot pattern matching.

>> No.66891455

you pulled all of that completely out of your ass
shit I guess scheme isn't functional because it has set!
>elegant looking code
subjective as fuck

kys bandwagoner

>> No.66891460

>shit I guess scheme isn't functional because it has set!
i don't consider lisp true FP, no.
>ignoring all the others

>> No.66891480
File: 26 KB, 600x450, 1427198636421.jpg [View same] [iqdb] [saucenao] [google] [report]

I fucking love C lmao.
I'm not even ironic.

>> No.66891504

Why would it be ironic?
What's not to love about C?

>> No.66891529

shit macros, implicit conversions everywhere, undefined behavior and questionable syntax

>> No.66891536

"module system"

>> No.66891537

no types
no safety
no meta-programming
no modules
no ufcs
pre-processor hacks
no real immutable
no package manager
no native build-tool
>inb4 all bloat / i don't need that / but you can do that with this hacky solution

>> No.66891560

I don't really understand the fandom about programming languages. You end up programming in most of them sooner or later.

>> No.66891564

It's not fandom as much as sunk cost

>> No.66891581

I learned assembly and haven't used it so far, but i found the experience enriching.

>> No.66891582

please give me any idea for something to write. i beg all of you I NEED TO WRITE ANYTHING BUT HAVE NO IDEA WHAT!11

>> No.66891589

Write a good VR game

>> No.66891590

That's what all fandom is

>> No.66891603

Write about how and why converting humans to AI which perfectly mimic them would be both death and immortality. Argue both cases to the best of your ability even if you disagree with it.

>> No.66891612

there is no fandom
learn all the languages you can and take the best and learn from the worst.
FP just happens to do most things very right at the cost of performance. But even performance is decent these days depending on what you do.

>> No.66891613
File: 14 KB, 200x200, logo-square-paper-bg.jpg [View same] [iqdb] [saucenao] [google] [report]

So, I've lately started using this site to help me learn how to code that was suggested to me from a friend who actually works in IT.

What do you people think of it?
Are the challenges too easy?
Are there any better sites/communities that come to mind?

>> No.66891635

>pre-processor hacks
>no meta-programming
complaining about both of these things is a blatant contradiction. You understand what a C++ template is, right?

>no real immutable
what the fuck makes properly-placed const any different?

>no ufcs
I'll give you that one, kinda wish it had this

>no package manager
I'm getting around to it, give me some time

>> No.66891644

What does ufc mean?

>> No.66891645

just implement all of that shit yourself, what's your problem?

>> No.66891647

ps. im quite a newbie, i'd like to write something on android

>> No.66891652

some of the challenges are bs for 5-10mins
some of the challenges are bs for 1hr+ and this is fucking stupid

>> No.66891653

Well good news because nobody knows the answer to the question of whether human translation to AI would mean death or immortality. In fact, it's probably unknowable, so you'd be hard pressed to get it wrong in any way that can be proven.

>> No.66891654

universal function call syntax. It's a gay hack.

>> No.66891660

make an app which is just a big button which if you press it, launches a dialog which reads "hello world"

>> No.66891662

pre-proc isn't proper meta-progamming, it's just elaborate aliasing.
>what the fuck makes properly-placed const any different?
const doesn't protect references.
universal function call syntax
if a function takes one argument you can implicitly chain them.

>> No.66891667


>> No.66891683

tOo SiMpLe

>> No.66891707

It's something you'll find in D, Rust, and Nim IIRC. What you can do is place the first parameter of a function before the function in a sorta object-oriented style. If it were a thing in C, you could call the following function

int some_function(char *const str, int len);

like this

int x = "hello world".some_function(11);

and it would be the exact same thing as calling it like this

int x = some_function("hello world", 11);

It might look a little hacky on paper, but as someone who writes a decent amount of Python, it doesn't look all that alien to me (seems kinda like the "self" thing with classes) but it could be very useful. I think it's a great idea and I'd be in full support of it being added to a later revision of the C standard.

t. C developer by the way

>> No.66891720

Here's something i want.
Create an overlay that looks like the terminator's vision(like when the T-101 was scanning the motorcycles or the body shapes of people) that you can run on top of anything you're looking at, and then lock onto some selected area in the field of view. Then it converts that into a gif or an mp4, complete with the sounds played during the terminators search.
On occasion my thoughts about something i see online make me think like that, and i regret that i cannot convey it to anyone.

>> No.66891730

const char *const str
is an immutable pointer to an immutable string, within the scope of the function for which it is a parameter. doesn't have to be const in the scope calling it. This forces protection of references, and shows the user that your function is safe to pass their pointers to.

>> No.66891744

>const char *const str
the absolute state
fair enough on the point though. immutability is the least of C's problems afterall

>> No.66891751

It's not too simple I remember one of my 1st C++ programs was 'Hello World' and that used 'cout' which as we all know is an object that a beginner wouldn't possibly know about. It's all about how deep you wanna go down the rabbit hole.

>> No.66891764

please don't do this, this is not UFCS

>> No.66891861

>this is not UFCS

>> No.66891869

it's disgusting and needs to be a compiler error.

>> No.66891870

Why is Iori so cute?

>> No.66891879

What do you mean?

>> No.66891897

there's no logical reason for it, besides maybe if you're getting into partial function application.

>> No.66891906

This is why artistic programming is better than business programming. Program stuff that is esoteric and cool. Stop re-implementing existing SaaS products and your happiness with the practice will go up.

>> No.66891909

>FP just happens to do most things very right at the cost of performance. But even performance is decent these days depending on what you do.
But since FP is much easier to multithread this should soon enough not be the case right?

>> No.66891927

Hopefully. And it seems CPUs are going the AMD route as well.

>> No.66891939

Learning powershell. I just did audio converter that loops all flac files and converts them to opus with ffmpeg, including subdirectory crawling and automated new folder creation and moving. Basic utility, done similar in bash script. Powershell is actually surprisingly comfortable compared to bash as its syntax is similar to C while allowing proper files as object handling like Python.

>> No.66891975

Just imagine the possibilities
int length = text.strlen();

char *part = text.substr(10, 5);

if (! part.isNullPointer()) {

Tbh, I find this more clear, because you see which variable the function is working on first and foremost

>> No.66892027

Then what is?

>> No.66892039

what i specified earlier.
functions which only take one argument you chain together.
or what i said>>66891897

>> No.66892065

you're looking for partial function application.
but i guess in the context of C, UFCS like that could be decent given the simplicity of C's features.

>> No.66892079

I don't see how this is much better than regular function calls desu

>> No.66892100

this lmao

>> No.66892107

it separates the variable from the applications.
string s = "Hello World";
writeln(indexOf(s, "Wo", 4)); // 6

could be re-written as
"Hello World".indexOf("Wo", 4);

it's a very minor thing, but in some cases it would be clearer.

>> No.66892173

I am learning openGL specifically because there is a tool i need and doesn't currently exist.

>> No.66892215

Is there a reason to limit the number of parameters you pass to a function other than readability?

>> No.66892221

if you're passing a lot of parameters into a function you can probably break it up into two functions.

>> No.66892225

having two functions is sometimes better than one with a giant ass arg list

>> No.66892237

Okay, so the hardware doesn't have any problem with long argument lists?

>> No.66892253

So you don't have to credit and pay other people.

>> No.66892255

If you pass too many arguments you'll probably spill parameters from registers onto the call stack but you really don't need to worry about it because it's a microoptimization.

>> No.66892260

Mkay, spiffy.

>> No.66892509

import std.algorithm: map;
import std.array: array, join;
import std.range: dropOne, only, save, zip;
import std.conv: to;

auto arr = "AGCGA".array;
auto result = arr.zip(arr.save.dropOne)
assert(result == "AG,GC,CG,GA");

Now do that without UFCS

>> No.66892510

Is it
Foo *foo
Foo* foo?
Also, what should ptr return functions look like?
Foo *get_foo_ptr();
Foo* get_foo_ptr();

>> No.66892533
File: 972 KB, 784x720, smugaime.png [View same] [iqdb] [saucenao] [google] [report]

>dealing with raw pointers

>> No.66892577

I mostly see other people put the asterisk next to the variable, but i prefer it next to the type. Because it reminds me that the TYPE is a something pointer.

>> No.66892591

literally doesn't matter

>> No.66892600

I don't know what is this ++ voodoo but * applies to the first thing on it's right so it doesn't matter.

It can get only confusing if you think that everything to right from foo* is a pointer.

>> No.66892612

I really like working with raw pointers. I used to be confused by them, but now i rarely ever fuck them up. Is that a thing which happens to people, or is there basically an invisible timer somewhere ticking down to when it bites me in the ass?

>> No.66892624

>too dum to optimise with raw pointers

>> No.66892630
File: 276 KB, 600x558, 1483899740618.png [View same] [iqdb] [saucenao] [google] [report]

>passing functions to templates as strings

>> No.66892649

What language is this?

>> No.66892652


>> No.66892677

his heresy is not condoned
t.another dedlang user

>> No.66892686

what do you guy think of a decentralized chat app that runs over bluetooth, essentially i want to male communication free(as in money: no need for a carrier just a phone and freedom:open source, free from any botnet) and secure. so every phone woud be a router, some problems average bluetooth range is small

>> No.66892715

Pretty sure that's just how it works. I still haven't figured out smart pointers though.

>> No.66892721


>> No.66892730

learn Haskell
i used to be a D shill

>> No.66892737

what in the world are you doing posting invalid d code in my thread?
strings are implicit ranges.
import std.algorithm: map;
import std.array: array, join;
import std.range: dropOne, only, save, zip;
import std.conv: to;
import std.stdio:writeln;

void main()
immutable str = "AGCGA";
auto result = str.zip(str.save.dropOne)

>> No.66892749

i already learn idris, the superior language on my down time.

>> No.66892751

meshnets are dank, go for it

>> No.66892756

Idris isn't superior though.

>> No.66892771

>dependent types
>totality checking
>compile time type-checked state machines
haskell is the biggest shit lang, and i will never not be mad you brainlets forced it as the poster child.

>> No.66892784

>Learning a functional paradigm language in a OOP world
what did he mean by this?

>> No.66892802

Fuck off retard, we've seen you before. It's literally just you, eternally mad that the superior Haskell programming language happens to be more popular. If all you cared about was dependent types, you would use Agda. The reality is that non-brainlets realise there is more to a programming language than dependent types.

>> No.66892807

t. brainlet

>> No.66892814

Idris is written in Haskell.

>> No.66892853

your point?
idris will eventually be boot-strappable if it already isn't.
Haskell also has
>lazy by default
one of the absolute shittiest things about it. It should have never left academia.

>> No.66892867

Jesus you're so fucking stupid. Keep using Idris but stop with the bullshit. Idris is inferior in many ways. Haskell has many flaws but none of them are the things you're bringing up.

>> No.66892871

import Data.List(intercalate)
import Conttol.Exception(assert)

arr = "AGCGA"
result = intercalate "," (zipWith (\x y -> [x,y]) arr (tail arr))
test = assert (result == "AG,CG,GC,CA") ()

>> No.66892904

granted his codes shit but you saving three lines on built in functions isn't really that great as well as looking a bit more clunky with the lambda

>> No.66892910

Tat's not invalid.
The point of that post was to show the necessity of UFCS. Too bad your irrecoverably autistic brain cannot infer this.

>> No.66892917

will learning wasm future-proof my employment?

>> No.66892919

UFCS isn't necessary for anything

>> No.66892929

wasm will be experimental for atleast another decade.

>> No.66892930


>> No.66892939

stop turning strings into arrays
strings are already ranges, they can be used with std.range

>> No.66892941
File: 205 KB, 2138x995, cstructwithmacro.png [View same] [iqdb] [saucenao] [google] [report]

>shit macros
Only annoying thing I've seen is needing to escape newlines and can't insert them for checking code after substitution, but that's too much for brainlets to handle anyway.

>implicit conversion
What? I can't even print shit without compiler warnings. Maybe you're just terrible at the language.

>undefined behavior
No, there's only one important case: whether or not char is signed. Which is defined, it's just a compiler opinion.

>questionable syntax
>questionable syntax
Maybe you should eat with your hands, so you don't accidentally kill yourself with a spoon

Yes I was writing an automatic memory allocator and paging system for fun. I should go back to it, it had options for automatically allocatable memory, manual memory, and swappable memory, and continuous memory without using circular buffers.

>> No.66892945

The only problem is that you're using a shitlang where parens are necessary for function application.

>> No.66892949

Use a language where you can define operators. Write one for chaining or for function composition.

>> No.66892951

someone's . a . brainlet . here . it's . not . that $ guy

>> No.66892964

guy . that . not . it's . here . brainlet . a $ someone's

>> No.66892971
File: 744 KB, 964x768, drinking.png [View same] [iqdb] [saucenao] [google] [report]

>no types
>no safety
>no "modules" (???)
>pre-processor hacks
>no real immutable
>>>>package manager
>>>>>>>>>>>>>no native build tool

>> No.66892973

meanwhile UFCS saves you from 12 spaces.

>> No.66892975

Yes, who doesn't like to create confusion as soon as you come across multiple arguments.

>> No.66892978

Nah, he had his evaluation inside-out too

>> No.66892980

New thread

>> No.66892988

You don't need those spaces. You would only need them if one of those things began with a capital letter (because it could be a module).

>> No.66892993

why so salty?

>> No.66893019

What language has the cleanest most beautiful syntax, regardless of its actual use-cases, etc.

>> No.66893020

>saves you
they aren't syntactically necessary though, just a good idea.

Lens users even like to remove the spaces from their lens compositions to mimic you. The heretics.

>> No.66893022

(.) and ($) are just operators you can define yourself.
You could do UFCS:
x & f = f x
infixl 1 &
But it's often better to do
(f.g.h.i) x
Or if you're writing a function
\x -> ...(above)...
You can simply do

>> No.66893031

Of course, but I don't use a case sensitive language

>> No.66893037

What do you mean?

>> No.66893105
File: 124 KB, 1235x1303, joiner.png [View same] [iqdb] [saucenao] [google] [report]

Is that guy a brainlet?

>> No.66893138

No but you are. Retarded C tard.

>> No.66893200
File: 211 KB, 1399x1440, joiner_v2.png [View same] [iqdb] [saucenao] [google] [report]


>> No.66894892

You mean anal edition

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.