[ 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 ]
>> No.72621231

This except I've written type systems and interpreters before and it just gets worse and more boring
>tfw you waste time writing boilerplate haskell only to delete it because the whole thing is dumb

>> No.72621277

third for thaskell

>> No.72621285

>What are you working on, /g/?
trying to decide what to do once I leave my dev career which could be soon

>> No.72621294

In the same boat as >>72621231, but I've taken the optimizer pill. Built an IR and implemented some basic optimizations on top of it before register coloring to assembly.
An optimizer is essentially a ton of math and a ton of graph theory. I find it more exciting to implement some optimizations rather than tweak an existing language a little bit and drop it after a year at most (after barely getting through semantic analysis).
As an additional upside, I basically only have to rewrite the front-end for any new language I decide to make in the future since the I have an IR.

>> No.72621312

Is boring and full of boilerplate

>> No.72621409

what do they look like?
do i just go with a rbtree + some hash function + a pointer to one or more stored values under a given node? (since hash collisions are possible)

>> No.72621465

Nothing in IT interests. What do I do? Programming is all I have.

>> No.72621476

mix programming with a different hobby.
most people bored of software, usually turn to robotics or homebrew hardware.

>> No.72621488

>try to delete a post
>Error: Our system thinks your post is spam.
good website

>> No.72621528

Trying to figure out Unix Domain Socket in Rust.

>> No.72621532

What is this poster's endgame?

>> No.72621656

I don't think that's it considering my lifestyle is very healthy. Only thing that could be improved is socialisation. I've also had blood tests done and nothing was found.

>> No.72621731


>> No.72622081

I'd fuck a type till it's dependant on my dick

>> No.72622265

Everyone should experience how fun JS is, even the grumpy netizens of /dpt/!

>> No.72622443

not at all, really depends on the app itself and its scope/complexity.
But a local web server is just easier to iterate on and manage if you just need something quick for a small app and it won't take much time.
If it's a serious project that has any chance of performance issues, then yeah, i'd probably go with a regular desktop application.

>> No.72622458

tell me why i'm wrong.
linear types are the only beacon i know of at the moment which has the possibility of making FP competitive with regular sys langs in performance.
But if there's something better, please let me know.

>> No.72623001

Because I really need some money and webdev seems the fastest way to be somewhat productive and make some projects to expand my curriculum

>> No.72623037


Being rude won't get you a gf

>> No.72623069

>separation logic
any recommended reading on it?
Or research langs no matter how obscure or unsupported?

>> No.72623107

>overqualified rejection emails or no response rejections because I don't have an inside connection
I feel like I'm going to hang myself. It's been 2 years like this

>> No.72623125

kys haskneet

>> No.72623421
File: 1.08 MB, 1916x1080, 1537379077881.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.72623872

>Writing anything except the common subset of C89 and C++98 for maximum portability

>> No.72623968

nah thats normal
they never look tidy

>> No.72623994

alright, cheers

>> No.72623995

An obvious improvement would be to factor out ((opcode & 0x0f00) >> 8) since you have it written three times.

>> No.72624056

>he thinks alloca isn't already complicated magic

>> No.72624125

>create a visual novel with no visuals
I see what you mean, but I'm a "kinda but not that good" writer and I don't really have inspiration. Thanks for the answer though.

>> No.72624433

Reposting from last thread because I need help

In a few steps here's what I'm trying to do for a project at work. Using spring boot hooked up to an Oracle database:
>build list of entities from a table by a particular field via a repository
>iterate through this list and delete by Oracle row ID in configurable batch sizes (but for now let's say 500)
The first part was pretty easy due to the flexibility of jpa repositories. But I cannot for the life of me figure out how to do the second step, there’s hardly any useful docs pertaining to using row id at all after googling the shit out of it. The repositories have pretty neat useful functionality to delete in batches, but my tech lead bitched me out when he got back from vacation because his design SPECIFICALLY called for this to be done by the row ID.

Anyone got any ideas?

>> No.72624700
File: 11 KB, 312x296, 1567433504235.jpg [View same] [iqdb] [saucenao] [google] [report]

>2 year gap = self employment, otherwise people won't even touch you with a 10 miles pole
also get some real experience, do freelancing, apply to project work

>> No.72624880

Don't tell me you're using C89 or something daft like that where you become scared of variables since you have to declare them up front.

>> No.72625087


Soooo I'm passing a pointer to an array of const char * to a struct and my strings are being mangled as if when I ask it for the next string is a list of {"hi", "bye"} It says its {"hi", "i"} silly c.

Is this why people use rust?

>> No.72625112

You're obviously incrementing the char*, not the char**.

>> No.72625174
File: 20 KB, 645x773, 1559649169113.png [View same] [iqdb] [saucenao] [google] [report]


>> No.72625188

The one I remember was all text, but this will do. Thanks anon.

>> No.72625266

yes but only if they're gud

>> No.72625277

It exists to manipulate pure addresses, not to do whatever you think you're doing.

>> No.72625295
File: 69 KB, 634x522, 1566214713069.jpg [View same] [iqdb] [saucenao] [google] [report]

Python was originally conceived to be an alternative shell language. It's also faster, more readable and a lot more powerful than any shell language.

>> No.72625298

I was multithreading a parser with Open MP because it was too slow. After I finished the code it was still super slow, I checked it in the debugger and it really had spawned all the threads that it should but it seemed to still go sequentially, threads were just waiting.

Then I started it in the profiler and not the debugger and I had a speedup of more than 1000x. Keep in mind while I was using the debugger I still ran it in release mode. Without the debugger even the single threaded version is now faster than it needs to be. I wonder why that is, never seen such a difference between running in the VS debugger vs. just starting the .exe.
I think it might be because I use exceptions in many places? I don't know.

Lost over an hour on that, but now I am starting my weekend with a glass of wine.

>> No.72625355

Which includes reading and writing addresses. Doubling pointer operators is bad practice.

>> No.72625366

there are things that are a lot more convenient to do in shell than in python so i'd say it's worth it. shell is pretty easy to learn, just get shellcheck to tell you when you write stupid things and use `set -x`, i find these very helpful.

>> No.72625374

Yeah but it just feels more suitable to learn shell since shell is already there compared to Python which is something external and separate you gotta download and install

>> No.72625554


if it wasn't bloated maybe.

bash has the right idea, running a command should be one char, not the 4 liner I see here


>> No.72625654

What? You can use an editor with syntax highlighting for writing scripts. Not like it's really necessary. All you need to learn are if statements, variables, special variables like $1 etc that get command line arguments or last command output, and quote/spaces hell. Maybe you learn loops, but you won't need them much if at all

>> No.72625732


>> No.72625738

That's because starting with 2 and in totality with 3, python decided to abandon the dream of replacing bash.

I actually agree for very very simple tasks, bash is better. The use case of bash scripts for me has been for tasks I would otherwise type in a single line on the terminal with copious use of "&&".

For complex operations, python is better than bash. Calling external programs from python isn't as easy as bash, but if you're doing anything with control and data structures inside of your script, you're probably a lot better off with python.

It's important to note that a lot of the usecase of bash is calling the GNU core utils, and the Python stdlib has many similar functions defined inside of it. os.walk() uses the same syscall as ls, but it's a lot easier to programmatically work with the data.

That's my own piece. I think you should learn DOS/Batch + Bash + Powershell eventually, but python should definitely be your priority.

>> No.72625778
File: 153 KB, 803x803, JasonTurner.jpg [View same] [iqdb] [saucenao] [google] [report]

use raw string literals.
and const, too.

>> No.72625785
File: 296 KB, 3840x1080, scrot.png [View same] [iqdb] [saucenao] [google] [report]

>What are you working on, /g/?
Got my fizzbuzz down to 173 bytes

nasm -o fizz_buzz fizz_buzz.s

%define stdout 1
%define sys_write 4
%define sys_exit 1
org 0x00200000
db 0x7F,'ELF',1,1,1,0
times 8 db 0
dw 2
dw 3

>> No.72625915
File: 67 KB, 722x625, 1558974491098.jpg [View same] [iqdb] [saucenao] [google] [report]

sounds good. program it asap

>> No.72626018

I suppose you are dependent on an IDE for python or java or c# or whatever shitlang you use?

>> No.72626269

I suppose your parents never taught you any manners.
It's fine.

>> No.72626333

pursue a goal. a big goal. a crazily big goal.

>> No.72626434

do you mean something like this?
select * from mytable where price <= 1000 and status = 1
>wtf am i a brainlet
more like you need to read an SQL tutorial

>> No.72626517

Imagine installing Linux just to make yourself reliant on a bloated monotlithic IDE

Might as well have stuck with windows at that point

>> No.72626614

>editing scripts in a text editor then running them is complex
>defending editing all of your scripts on the command line in one line instead of using a fully featured text editor made for that purpose
>conveniently opening man pages in said editor and displaying them along side your script and being able to search said man page is more complicated than rerunning man constantly and scrolling to the point you want to look at and looking for relevant parts by hand

>> No.72626673



Or I'm not a system admin and I'm not in the shell doing anything that complicated

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

>start learning c
>basics are easy
>array more or less
>cannot grasp really what I am learning from pointers onwards
I am already planning to buy the C language book since it is just better for me to have something physical if I have to learn something, but is there a online/app to learn C which isn't trash for novices? It seems that from a point onwards they just accelerate without reasons and I am lost. Or it is just better to start from another language?

>> No.72626737

>editing files with text editor then running commands in the shell is only for sysadmins
Lmao, should've stuck with windows

>> No.72626764

>the wrong thing works
I don't understand this on a language level, I am German.

>> No.72626785

Compare the first item to all of the items after it (all but the first item)
Then compare the second item to all of the items after it (all but the first and second)
Etc etc
This not only solves the counting with itself issue, but prevents redundant counting too

>> No.72626806

how do can I do this without using indices though? afaik keys don't have an index in dictionaries.

>> No.72626841

I liked Eclipse. I even wrote plugins for it for money, some 10 years ago. Since then in turned into shit tho. Or so people still involved say.
>Visual Studio is bare bones as fuck without Resharper
Nigger, you have no idea what are talking about. Up to, including VS2010 Resharper was obligatory plugin. Since then? Not so much. You can work in VS2017+ just fine.

>> No.72626882

Anyway: sure buy the C book, or download it if you want. But honestly if you think that having it in a physical book form helps you even a little, just buy it. If you think about it the costs of the book is nothing, if you live in the west it's like 3 hours minimum wage work, the real investment is the time.

I am not sure if the book will help you with pointers thoug, it does explain them, but at some point it assumes you get them, there are no clever metaphors etc.


This is a whacky video but it explains what pointers actually are.

Anyway I am here for a bit more untill I pass out from the wine, so if it helps throw your questions at me.

>> No.72626883

Can't you get a list of all keys? Then you can iterate over that.

You can also prevent more redundant checks if with your array of keys, you remove keys whose values you found to be duplicates, while also removing the key you are checking with from the front of the list. But that could potentially not provide any real speed increase because deleting from an array.

>> No.72626888

I'm. And constexpr too. Although VS2019 compiler is too lax with it.

>> No.72626915

Pointers are a really simple concept, and I think that most people actually do understand them.
What they fail to understand is the amount of book-keeping that (raw) pointers require you to have, in order to avoid derefencing a dangling pointer, memory leaks, things like that.
Pointers are simple, but understanding how to use them correctly is difficult.

When I first learned C/++, the hardest thing I couldn't understand is why people had so much trouble with pointers. It wasn't until learning about more advanced and more abstract concepts that I understood how pointers cause problems.

>> No.72626923

>use rust
>don't have these problems because immutability is the default and strings are a zero cost abstraction

>> No.72626957

>Anyway I am here for a bit more untill I pass out from the wine
So am I. What a coincidence. Are you a Jew?

Good C book by the way (that I own and read time after time) is "C. A Reference Manual" from Steele (yeah, that one. Except his son I think).

>> No.72626958

>immutability is zero-cost
there's no runtime cost associated with a compile-time enforcement that nothing mutates the data, but there is a cost in using more expensive algorithms.

>> No.72626994

Retard. Making everything const by default is absolutely correct.

>> No.72627068

This is correct but really I only wanted to help a complete noob understand that pointers are addressess and why pass by pointer is faster than pass by value xD

I have watched a talk on how the GSL fixes problems with pointers, but I am still sceptical, have to verify it myself.

>> No.72627070

Yeah, it feels good to have some wine in your belly after week of work.

>> No.72627076

ah I think this will do the job, ty.

>> No.72627098
File: 356 KB, 1920x1080, IMG_20190317_130607.jpg [View same] [iqdb] [saucenao] [google] [report]

I'm working on a new C64 demo. 13th September will mark my one year on c64 scene so it's gonna be some kind of anniversary intro or something. Got a big 64x12 chars logo swinging already and I want to do a 32 border dysp scroller.

here's my page on Commodore scene database, you can see my previous work. Some of these are open source, I can post links to my git if you want

>> No.72627099

Backward compatibility at all costs in sepples was and still is a mistake.

>> No.72627109
File: 289 KB, 1920x1080, IMG_20181018_220845.jpg [View same] [iqdb] [saucenao] [google] [report]

forgot the link lol

>> No.72627131

Sepples const optimisations revolve around compile time constants (i.e. Constexpr and where it is inferred) and not runtime bindings.
Dumb rusttranny.

>> No.72627155

I am brainlet. What does runtime bindings mean? So far I think that constexpr is guaranteed to be compile time and cost is likely to be compile time?

>> No.72627187

Compile a mandelbrot image using constexpr :^)

>> No.72627207

what do you write your programs for the c64 in?
C, assembly, a mix of two?
also, how do you even copy it over to that thing

>> No.72627208

It will rewrite const as constexpr? Why is that a mistake?

>> No.72627266

We didn't have those magnificent beast here... Well maybe folks in Moscow and other prominent cities did, but my parents did not. And yes, my BK-01 LVIV certainly wasn't very melodic, lol :)

Good luck with your demo, bro!

>> No.72627348

what's the difference between a total recursive function and a primitive recursive function? it doesn't seem like the extra clause for primitive recursion (the one that allows the base case to be undefined) can be used since it needs to be defined for all arguments. the only other thing that seems to be different is unbounded minimization.

>> No.72627424

This is why in rust the const qualifier is different from an immutable variable, that way you can be explicit about it just being an immutable static variable or a "constexpr" that can be substituted anywhere it is named

Rust wins once again

>> No.72627481

>not just defining new types

>> No.72627532

not a valid main signature

>> No.72627552

typedef unsigned long long long-long-long;

>> No.72627709

extern static inline unsigned long long *c[2] __attribute__((aligned(32)));

>C, not even once

>> No.72627732

that's C++, C doesn't have inline variables afaik

>> No.72627870

extern and inline might conflict but i dunno

inline variables in C++17 can be declared and defined in multiple translation units as long as each definition has the same exact value, it's to avoid the problem of duplicate globals
extern does a similar thing in that it only declares a variable which must exist elsewhere at link-time

>> No.72628017

thanks, very interesting stuff
i was wondering how far you could go with writing portable C code

>> No.72628062 [DELETED] 


>> No.72628075

What is it with programmers refusing to let go of the past? It boggles my mind why there are people still learning about COBOL or Fortran. Hell even C is pushing it these days.

>> No.72628313


>> No.72628318

as trannies they look up to their predecessors and thus subscribe to the Apple model of innovashun

>> No.72628341
File: 2.14 MB, 1153x1500, adb8e0913e218855463eafb95acf418f.png [View same] [iqdb] [saucenao] [google] [report]

Silly me, I posted the crappier pic.
Here is the improved pic instead.

>> No.72628347

you seem awfully personally insulted

>> No.72628358

>These types (and later, aggregate types composed of these) are all
transparent. That is, their internal form is exposed and the shader code
gets to assume what they look like internally.
An additional set of types, the opaque types, do not have their internal
form exposed. These include sampler types, image types, and atomic
counter types. They declare variables used as opaque handles for accessing
texture maps, images, and atomic counters
whats a transparent/opaque type?
>illya is busty
cmon bruh

>> No.72628554

I'd assume less assembly code would allow for faster execution and smaller output size.

>> No.72628698

stupid niggerfaggots. Have a room.

>> No.72628734

Nothing to see there, out of order execution is since the very first Pentium.
The less there are instructions, more of them fit the code cache register. Nuff said.

>> No.72628763

At what point is it okay to give up?

>> No.72628790

There are people too dumb even for Python, but they still keep going.
You sure you want to be below those people?

>> No.72628792

Do you know what's worth fighting for
When it's not worth dying for?
Does it take your breath away
And you feel yourself suffocating?
Does the pain weigh out the pride?
And you look for a place to hide?
Did someone break your heart inside?
You're in ruins

When you're at the end of the road
And you lost all sense of control
And your thoughts have taken their toll
When your mind breaks the spirit of your soul
Your faith walks on broken glass

>> No.72628906

could you innovate a new joke for once?

>> No.72628939

>thinks that I would write my own emulator if i actually needed one
it's just a personal project, relax

>> No.72628961

give up what?

>> No.72628967
File: 400 KB, 3062x1098, 1566782592157.png [View same] [iqdb] [saucenao] [google] [report]

/g/ lacks creativity.

>> No.72629127

Transparent/ opaque refers to whether or not you have access to the internals of a type. Opaque types hide their structure from you so you can pass them around but you can't access any data members with "object.member", for instance

>> No.72629178

When you return to a language you haven't used in a long time, it can take some time to brush up on it. You may need to reference things, struggle, and then sleep to let your brain freshen up connections to things you learned previously. That said, you could do a binary search of past material to see how far back you need to go to be able to solve the exercises.

>> No.72629304


>> No.72629364 [DELETED] 
File: 261 KB, 785x1000, 1565193335841.png [View same] [iqdb] [saucenao] [google] [report]


>> No.72629380

then, how is a integral types transparent? im reading opengl data types in case that means anything

>> No.72629413

You know all the details about an integer and it's representation as bits. In contrast, when OpenGL hands you a GLint that's a handle to a texture, you can't access manually access any fields of the texture object behind the handle. It's opaque. You don't even know it's size, and can only refer to it with the handle

>> No.72629448

Who works remote here? I'm a newbie but i wonder about how it is. I have to move to Russia in the next few years and don't exactly have a plan for making money

>> No.72629547

How do I stop feeling absolutely retarded and stupid?
I'm making this visualizer for sorting algorithms with vanilla JS, HTML, CSS.
The front-end is complete, the whole thing is structured and prepared for me to just write the damn algos
The thing is, as the algorithm is executing, I need to reflect that in the DOM in a way that makes sense. After all, the whole point is for the user to see the sorting visually.

So far the only method that's finished is bubblesort, the function looks like this:
The sorting happens after random black bars are rendered to the user, so all the function does is take the bars that already exist, sort them, and color them along the way for visuals.
const bubbleSort = () => {
let i = 0
let shouldSwitch
let bars = document.getElementsByClassName('bar') //gets all the bars currently in the screen
for (i = 0; i < bars.length - 1; i++) {
bars[i].setAttribute('id', 'done') //changes color
shouldSwitch = false
if (parseInt(bars[i].innerHTML) > parseInt(bars[i + 1].innerHTML)) {

>> No.72629663
File: 32 KB, 483x463, 1562602085990.jpg [View same] [iqdb] [saucenao] [google] [report]

>a small C compiler is 12,000 lines.
Wtf why? It's such a tiny featureless language.

>> No.72629728

ES5 is the true Chad choice.

>> No.72629729

>for (int i2 = 1; i2 <= i; i2++) {
you don't need to check it for every integer up to N,
consider what is the 2 largest divisor of any number N?
its N and M where M is the number such that M*M = N
thus, there is literally no number to be checked within N and sqrt(N)

also, its better to
>always be ready to print, but if some check fails, exit early and redo loop
instead of
>check check check, keep a counter, then if all check succeed, go print
the former have way less branching and does not occupy any memory

also prompt the user for a goddamn number with a text bro

>> No.72629797

consider this one
int main()
const int x = 100;
for (int i = 1; i <= x; i++)
bool print = true;
for (int i2 = 2; i2 <= i / 2; i2++)
if (!(i % i2))
print = false;

>> No.72629806

Thanks for the tips anon.

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