#code-talk

2 messages ยท Page 13 of 1

long raft
#

linux stuff gets hacked because of busybox.

fickle aurora
#

the thing is, for the exception of a PC, most things have firmware that can't be changed without literally soldering wires to the side of the chip and programming it with a special programmer device connected to a computer

long raft
#

well like how computers used to be specifically designed machines, they became more versatile

#

i kind of expect maybe the day of firmware may be coming to a close

#

or dimming

fickle aurora
#

I forgot to add about malloc, the reason I don't need to allocate memory on a microcontroller is basically because malloc is really an OS thing, it's about reserving memory so one program can't write over the memory of another program

long raft
#

on an embedded device you dont need heap memory at all, because you are not forced to share memory

#

you can just use the stack

#

but if you wanted to use a heap allocation youd need to system call the OS

fickle aurora
#

when you make a program for a microcontroller, if it is programmed into the firmware, then that program /is/ the operating system

long raft
#

yah

fickle aurora
#

if it is programmed in arduino for example, arduino has a bootloader firmware which is separate from your sketch files

#

so really when you use arduino, the arduino bootloader is your OS in a way, and your sketch is just a program

#

when you instead use atmel studio or mplab instead you are not making a bootloader, you are making the whole firmware

long raft
#

well, does arduino have a real time oS?

#

because if so, then sure; thats what i would prefer, frankly

fickle aurora
#

however there are libraries you can use which have custom bootloaders

long raft
#

i dont personally see that as advantageous. its like touting the merits of a one-time use rocket booster

fickle aurora
#

there's just so much you can use but it is more efficient to have your entire program run with nothing between your program and the CPU

long raft
#

i would prefer not to deal with all the boiler plate and i would like to program logic

fickle aurora
#

for example, arduino can't do anything for ATtiny10 because it does not have enough memory

long raft
#

you embedded guys are nuts for this stuff

#

i cant understand the interest

#

its like you enjoy it because its difficult, not for what it can do for you

fickle aurora
#

this gives you an idea just how small the CPU is lol... last I checked it was about the size of a grain of dry rice, and really hard to solder wires to it even with a magnifying glass

#

the picture is also taken through the magnifying glass

#

the USB connector is there to compare the size

#

anyway what the program will do is save a couple dollars by replacing a bunch of digital logic gate chips with this, so it can be used to turn something on or off with push buttons, one button for starting (PINB0), one for stopping (PINB1) and then outputs are on PORTB2 and PORTB3, where PORTB2 would be high when the stop button is pressed or simply at the beginning of the program before the loop, it would be set high, and would switch off when start is pressed - similarly PORTB3 would be on when start is pressed and off when stop is pressed, so you kind of have the ability to output to something when something is stopped

#

and so this is where the book reading comes in

#

to set an IO pin to be an input or to be an output, basically this DDRB register is used to set 4xIO features to be inputs or outputs, where a 1 designates it as an output

#

so you can see on the highlighted line, it is setting the PINB0 part of DDRB to zero, though by default it is zero, I just like to be on the safe side and make sure it is zero

cursive river
#

This chat is big brain

severe jewel
#

4 hours of big brain

fickle aurora
#

so I could send bits of course, I could instead write DDRB = b0000 to set pinb0 to be an input instead of output, but this would also make all 4 IO to be all inputs, even if I wanted just to modify the value of only one bit

#

I should say the file designates all IO for the ATtiny10 as PB0, PB1,PB2 and PB3 for pins 1, 3, 4, and 6 respectively, but the compiler does not have those definitions, apparently deprecated or something so you have to write it as either P<IN/ORT>B<number>

long raft
#

since i know normies are reading now, check out the difference between normal resizing and ai-enhanced upscaling - waifu2x

fickle aurora
#

but if you took a proper programming course you may have heard of LSB and MSB, it turns out this is MSB

#

so to set PB2 and PB3 to output you can just do DDRB = b1100; and omit the 4 lines of code I wrote

severe jewel
#

finally, 4k grom will be a reality.

long raft
fickle aurora
#

I just have a different style but the compiler packs it into bits anyway

long raft
#

im gonna push it to 8k

#

standby with fire extinguisher

fickle aurora
#

I was trying to explain how it works so you have an idea what the code was doing

long raft
#

hes making fun of us in the other room tho for being dorks

#

i know anime girls sell

fickle aurora
#

I have to admit, I didn't take a computer course, I took instrumentation and electrical engineering, I always knew software development was going to be flooded by the masses

#

the masses are just given the easy work and they think they know what they are doing until their projects start dying to bugs they can't fix

long raft
#

people want very complicated things

#

@severe jewel i've done it. i've achieved grom8k. its amazing how it looks the same as a thumbnail

#

holy hell thats a big image

neat fossil
fickle aurora
#

discord has trouble handling standard file sizes in 2020

severe jewel
#

that's going up on the wall

fickle aurora
#

apparently also has trouble with bitrates in streaming in 2020 as well

long raft
fickle aurora
#

isn't that the painting of jesus that someone mutilated after it got wrecked?

long raft
#

yea

#

like i just did to the grom reaction grom

fickle aurora
#

I mean I like the meme but on a more serious note it was a really terrible tragedy

long raft
#

its sad. but nobody died. and we still have pictures of how it used to be, right? and now its also fun

#

i would have nothing else to compare grom8k to

#

i decided to leave the art filter on when i upscaled that

severe jewel
fickle aurora
#

yea boomer that was absolutely nuts I am surprised they could never find someone who could copy the original one

long raft
#

wasnt the lady a famous artist?

#

maybe just beyond her ...prime

fickle aurora
#

and you wonder why everything is going offshore

long raft
#

not really. ive seen americans' grasp of math

fickle aurora
#

the problem is, and I include my own country, we all have lacking standards

long raft
#

they happily scoff at one another "who needs algebra, seriously?"

fickle aurora
#

the quality of what we can do is really poor and increasingly becoming worse, but we need to push education a lot more

long raft
#

its just expensive to get that work in the US

fickle aurora
#

by that I mean start forcing grads to be good at what they do

#

if they can't pass tough tests, fail them instead of lowering the standards

long raft
#

you know its like a 120,000 dollar a year job, very intense labor competition

fickle aurora
#

if people really want to pass they will do the work or they can simply fail in my opinion

#

in my college course most of the class failed fluid mechanics so the dean downgraded it to high school physics

#

all because the majority rules too much

long raft
#

not everybody is prepared to do that much work at that specific moment in their life

fickle aurora
#

I would be perfectly happy if the vast majority failed

long raft
#

its better off if people are exposed to the ideas and know they are there to come reference later

fickle aurora
#

the thing is we need much higher education standards if we want to compete with china

#

most of what I know and do is basically self taught

#

I would say 100% of what I did in college for engineering was useful, but it just was not enough

#

most people complained the whole way about the course difficulty but I found it too easy

long raft
#

it sure helps if youre passionate about the subject

fickle aurora
#

like we learned about bypass filters but even the instructor couldn't explain what they were needed for, it wasn't until I started experimenting on my own that I found out just how important they are

#

literally most of the time the people teaching the stuff don't really understand it, their job is just to cover the content of what is listed in the course outline

#

the motivation of the college as a whole is masses of students to make profit, even in publicly funded college systems as in ours

#

the instructor first said at the beginning of the course, transistors were outdated so he wouldn't cover them - I pressed for it and we got it, but I noticed he didn't really understand them which is probably why he didnt want to cover them - now I have bags of 100 each of them because they are one of the most used item for switching stuff on/off without burning out low current terminals or for audio or making sine wave, etc

#

I basically had to do a full blown electronics course online after I passed his course, and I got far more involved

#

but this is why I also like the 1970's books on computers because a computer today is too complex to understand entirely, but when you go through the history, build your own 8 bit computer and program it, then move on to more advanced computer tech from the late 80s and so on, you start to see how the original 1970's concepts are still in use in every modern computer

severe jewel
#

guess I should take note of that

fickle aurora
#

yes, how effective has the baloney marketing been at convincing us that tape reels are outdated? the national archives still use them - in fact, IBM makes new standards to LTO tape drives even now

severe jewel
#

aren't most servers on magnetic tape?

fickle aurora
#

data is still largely held on magnetic media

#

well tape is hard to access dynamically so it is mostly archival

#

floppy disks were a way to make dynamic magnetic storage that could be randomly accessed because it's literally a spinning disc like a hard drive

#

I would be interested in inventing perhaps a high speed tape that could be accessed randomly, but to be honest that would still be slow as heck

severe jewel
#

I mean, isn't most research just looking at what can be done, even if it's not practical?

fickle aurora
#

yes it is bearded men with soldering irons inventing most of what you see, but they put a smiling beach girl on the package to sell it

#

I mean, when you think of the word speed, to you does it mean just latency, bitrate or a mix of both?

severe jewel
#

probably a mix

fickle aurora
#

with a high speed tape reel you could have high bitrate but also high latency

#

smart defragmentation could be done at random times

severe jewel
#

I'd got nearly no insight to see how hardware like that could come in handy but I'm willing to bet that there is some (relatively) obscure field out there that might need something like that

fickle aurora
#

well you know the very first implementation of magnetic storage was a metal band that was dangerous because it could snap and hurt people badly, but even though flexible tape replaced it, guess what, that outdated idea of using metal for storing magnetic data is not lost as it is used in flight recorders because it can't be burned

#

actually it was used for audio not data

#

but now of course flight recorders use a steel wire instead of a metal band, but same concept

severe jewel
#

oh yeah, know someone who works in aviation that told me some about it

fickle aurora
#

so people keep thinking outdated is a thing, but we keep seeing outdated technologies suddenly becoming new

severe jewel
#

most of the stuff we use were laid down in concept years ago

all that makes a difference is perception of the masses

fickle aurora
#

tapes use caching, so there is a lot of the file allocation table data stored on EEPROM that is built into a controller and of course some little bit of SRAM for streaming bits into buffer to make packets/reports to send to the computer... this is why new tapes are expensive

severe jewel
#

don't mind me, I'll digest this information for a bit

fickle aurora
#

every tape is basically a mini computer just to handle the addressing of where file bits are located, how much PWM to send to the stepper motors to get to the address location, then you have to buffer the data and make a report which includes your vendor ID, USB page data, the packet header, packet of data, etc

#

well at least there are no motors on the tape so there is savings there

#

you could opt to use the old tape standard, instead of a cache and all this, it's just a simple thing of reserving the first length of tape for storing the allocation table and then the rest is data, but then you'd have to rewind the tape each time just to open 1 file

severe jewel
#

oh yeah, it is slow in that regard

fickle aurora
#

yea the archives used to have the old standard at one point but even though it is cheaper to archive data like that, the problem is the allocation table limit

#

of course it is no coincidence that FAT in FAT32 stands for file allocation table

#

though even all the other formats are file allocation tables, just done differently

severe jewel
#

I'll come back when I get a grasp on this before I make retarded statements

fickle aurora
#

if the bits don't make any sense and the compiler is eating itself you can always have a beer

severe jewel
#

hm, so I guess all types of data storage needs a directory

fickle aurora
#

to be honest punch cards don't sound entirely like a bad idea, if you used a laser to burn marks into a paper you could use different burn temperatures to generate byte/multibyte codes instead of simple bit codes using different burn patterns

severe jewel
#

can it stay consistient enough to read that?

fickle aurora
#

can reinvent the QR code using a totally new standard

#

well the only thing I can see something like that used in is for like a bar code thing

#

or maybe forensics

#

perhaps have printers burn a code on every paper they print to identify the printer that it came from

#

I mean they already do that with ink

severe jewel
#

ooh, would be good for archiving

fickle aurora
#

I love how the first laser mouse worked, so there was a special mouse pad, if you lost the mouse pad it was very expensive to replace and the mouse needed that pad to operate

severe jewel
#

seems about right

fickle aurora
#

it was made by Sun Microsystems

severe jewel
#

stuff seems specialized as hell

fickle aurora
#

yeah there was a special grid pattern in the mouse pad and as you moved the mouse the photodiode would detect the x or y direction of movement on the grid

severe jewel
#

yeah that seems like someone making a laser mouse for the first time would make

fickle aurora
#

laser mice moved to using a camera instead, and there is actually software now that you can use to take pictures with your mouse, albeit really low quality, but hilarious

severe jewel
#

that seems like something I missed in my age

fickle aurora
#

I am surprised the tin foilers aren't still using ball mice

severe jewel
#

Ball mice work alright

fickle aurora
#

just have to clean the rollers

severe jewel
#

yeah

fickle aurora
#

when they get shiny they slip

severe jewel
#

I used to have a Ps2 one that I dug up that had a bit better ergonomics than my current one

fickle aurora
#

the original ball mice with potentiometers I find are better than the newer ones that use rotary encoders

#

the thing is with potentiometers you can have a smaller area to move your mouse fully around the screen

#

they aren't infinite

severe jewel
#

interesting.

fickle aurora
#

the only thing I can see the old stuff being useful for really is digital artists who might want to try something different for freehand drawing

severe jewel
#

eh, I'd rather stick with a ball mouse than a surface sensitive laser mouse
partly because I'm a lazy ass

fickle aurora
#

so far my only useful coding projects were for an automatic door opener and another one for automatic realtime power switching in a surge protector

#

other stuff was mostly modular not really big projects but used for other projects

#

it is hilarious that I can use a bunch of small batteries to open a big heavy door, though it is slow and uses higher torque based on gearing

severe jewel
#

hey, what works works.

fickle aurora
#

the only thing stopping me from doing better projects is anything that uses more than like 30-50 volts requires underwriter labs testing and certification

#

the other thing is RF modulation requires industry canada testing

#

or FCC for the US counterpart

kind glacier
#

I managed to fuck my installs and not even a reinstall fixes my problem

#

kek

#

just flat out deleting the folder fixes it

#

back to square one

kind glacier
#

managed to get the maps list again

#

Now I just gotta figure out how to use it

vague otter
#

The wonders of VS

kind glacier
#

The wonders of downloading a github nuget plugin in an attempt to get JSON to work

vague otter
#

what plugin you using? and why isn't it newtonsoft.json?

kind glacier
#

because the guide I was following was using system.text.json specifically

long raft
#

json built into dotnet core now

#

i keep meaning to replace my code with that

fickle aurora
#

VS is garbage imo, it takes a long time to load and then says my license expired

#

Atmel is free to use and has better compilers, doesn't crash or freeze all the time, and you can theoretically write windows programs in it

#

however its main function is programming Atmel microprocessors

barren quarry
#

Vs code is amazing

#

Vs code with typescript is gachigasm

fickle aurora
#

I can probably bet on the fact foxhole devs use Atom instead

#

there is absolutely nothing good about VS once you start modifying the underlying code for a window the program will start giving you trouble

#

you know what's interesting is that VS 2004 had the same bug it has now

#

Microsoft literally does not care

#

your only option around the bug is simply create your windowed programs all as console apps and then implement the window features in code rather than in the visual IDE

#

to make things easier, you can use 2 separate solution files; one to generate the automatic code from the visual IDE, and one for your main solution and just copy paste the auto generated code over

#

I still use VS 2005 on a windows XP machine that does not connect to the internet, the only reason being that MS for some reason gave us all free unlimited licensed copies of 2005 edition long ago, but now you have to pay a subscription fee

barren quarry
#

What about community edition

fickle aurora
#

I don't use cloud

#

I get that they want to force everyone to use public hard drives but most of us keep our tin foil at bay even if theoretically tin foil actually increases the likelihood that your head will conduct more electromagnetic waves

barren quarry
#

How do you do git commits then

fickle aurora
#

I don't use github though the idea of openly sharing everything sounds great

#

there's a reason I am writing my own compiler and my own libraries julianlol

barren quarry
#

Basically you create a private repo

#

Commit there when you do something

#

And if your hard drive dies you lost at most 2h of progress

fickle aurora
#

yeah it's private so long as nobody knows how to inject sql commands and leak data from the servers

barren quarry
#

Ew sql injections

#

This is 2020 gramps

fickle aurora
#

things like cloud/github/etc are really bad for any team that wants to create proprietary software or firmware

#

you can use SVN on an intranet

#

or CVS if you are old school

pure sierra
#

you can use git in a directory on your computer

#

no net necessary

fickle aurora
#

I don't use version control, because I don't want to keep my failed contraptions

#

I suppose so, but there is nothing wrong with SVN

barren quarry
#

Do you at least cover your code with tests

fickle aurora
#

you mean simulations?

#

or debugging?

barren quarry
#

Anything to check regression after changes

fickle aurora
#

most firmware development kits like atmel studio have built in simulators that simulate what will happen on the CPU before you upload the code

#

they can't simulate smoke though

kind glacier
#

I don't like community edition

fickle aurora
#

and they can't simulate my computer suddenly rebooting when I short positive to ground through USB accidentally

kind glacier
#

gib Enterprise

barren quarry
#

Oh i see

#

Cause javascript is a bit different

#

it can run and never tell you that something is wrong

#

so you have to cover that shit with tests so that SOMETHING fails when there are errors introduced

#

and even then its not enough

fickle aurora
#

one mystery I wonder is how VS handles makefiles, I could never find the options to set VS up for that, but other competing software has all of it built right in

#

but then again MS is a competitor to GNU free software foundation, so there is that reason probably

#

idk personally I like XC8, I don't use GNU C, but I do use gmake

#

you can use GNU C to make something proprietary as long as you use your own standard libraries, but on the flip note the problem with GNU C is that it's a community run open source project, and that means it is basically a jack of all trades but king at nothing

long raft
#

people still use gcc? thoguht everyones moving to llvm

fickle aurora
#

I would say over 95% of the internet is full of programs compiled in gcc

#

you have to realize windows is a small world when it comes to server side stuff, on servers literally everything is written in C, and for those server side programs not written in C, it is almost always the excuse of "well C was too difficult" - yet entire GUIs and even full scale 3D video games have been made in it despite this claim

long raft
#

its time to get off your C is the best soapbox

fickle aurora
#

the reason people often say their software is C++ even though it is truly C to the C99 standard is that the real low level C is ANSI C, which is not used so much anymore - most people consider what is effectively the new C standard to really be C++

long raft
#

i think most people accept llvm is a better compiler than gcc

#

nobody considers the new standard to be C++

fickle aurora
#

if you are referring to .net, that is Microsoft based entirely

#

the thing is, languages are just a human readable input to a compiler - everything is essentially the work of the compiler

long raft
#

jesus christ.

#

im referring to llvm

#

the compiler that is literally replacing gcc

fickle aurora
#

yes I can see that but even then it will unlikely surpass GNU C

long raft
#

i dont know why you keep lecturing me on how compilers and computers work as if i dont know

fickle aurora
#

well from what you have been telling me, I assume you don't know, especially when you said we don't need to add null termination to strings anymore

#

I can tell you right now that statement is what triggered me, lol

long raft
#

pascal hasnt used null terminated strings for 60 years

#

you clearly dont have to

fickle aurora
#

here's the thing, ok, null termination has absolutely nothing to do with C, C++, C# or java or whatever, null termination is used by every CPU to understand where a character array ends

long raft
#

fake news

fickle aurora
#

you really need to study on how memory management works

#

you know pointers?

long raft
#

youve got to be kidding me

fickle aurora
#

a string is literally just an address pointer, the rest is a character array in memory and the CPU keeps reading bits in sequence until it reaches a null character that ends the pointer

long raft
#

i know how strings work. your assumptions are just incorrect

fickle aurora
#

you know why allocating is so important?

long raft
#

i know everything

fickle aurora
#

of course

#

so let's say you have 4 bits of space in sequence before some other value is stored in memory, but you want to store 6 bits, well, a string pointer is going to point to the first address of those 6 bits you want to store - of course, if you choose to write those bits, you will write over top of another variable's addresses... so by allocating memory, you're telling the CPU to reserve 6 bits somewhere in sequence and then it returns you the first address in that 6 bit sequence for you to start writing the bits to

long raft
#

i know very well how memory management works, thanks

fickle aurora
#

in C#, microsoft's compiler will automatically add 1 to any memory allocation to account for the null termination

long raft
#

i can tell you where you are incorrect if you want to know

fickle aurora
#

you don't have to worry about null termination most of the time in C#, however you still need to know it exists because if you assume you know and you are wrong you will cause memory leaks

long raft
#

your first example is a stack memory allocation. that works the same in C as in C#, they both increment a stack pointer and decrement it when its done

#

when you are talking about references, you are referring to a heap allocation, so its nothing like your first example. you are comparing apples and oranges

#

a heap allocation in C uses malloc or similar system call

fickle aurora
#

it is the same on every computer, even the same on a microcontroller as small as a piece of rice, every computer in existence uses null terminating characters to end strings

long raft
#

first of all, there is no null in C

#

so thats a ridiculous idea to begin with

fickle aurora
#

where did you read that?

long raft
#

its asciiz, the z means zero

fickle aurora
#

no it is not 0

long raft
#

in the same way that C has no true or false, it has no null either

#

asciiz is a convention, it is not a requirement of cpus

fickle aurora
#

if you write 0 it will translate to integer value of 48

long raft
#

and just as i explained how pascal has not been using strings terminated with 0 or null for 60 years, its clearly not a requirement of the processor

#

im talking about 0x0 not '0'

fickle aurora
#

an integer value of 0 is null, that is correct

long raft
#

its not null, there is no null in C

fickle aurora
#

but 0 in a string is 48

long raft
#

i know what you are trying to say but i dont know why youre bring it up. im not talking about the string value of 0

#

it should be clear im not talking about that

fickle aurora
long raft
#

no im not saying that

#

ill put it this way, old x86 had an interrupt for printing strings. the terminating character on those strings was $

fickle aurora
#

you know what TCHAR is for?

long raft
#

0 is just another convention that doesnt really get used in modern languages, even C abandons them for actual string implementations

#

TCHAR is a macro, so its like a official language feature

#

its just a 16 bit number i assume, a wide character

fickle aurora
#

you are really missing the basics

long raft
#

maybe its 32 bits i dunno

#

bruh you are stuck in a tiny segment of C and you think you know C

#

This is ridiculous to talk about this was hashed out by much smarter people than us over 50 years ago

fickle aurora
#

you're the first guy I have met who said that null termination is not used anymore

long raft
#

its not

#

its still used sometimes in C

#

but even in C people use string libraries now that dont use zero termination

fickle aurora
#

it is used all the time in any kind of string

long raft
#

ok whatever

fickle aurora
#

heck it is even used in arrays

long raft
#

i really dont care

fickle aurora
#

so I have to admit, I don't program in unicode, so I looked up null termination in unicode just for you because I know C# is all nuts about unicode in order to support multi language development

#

I don't even use unicode, but even without using ASCII and using unicode tables instead, even in that scenario, Microsoft says you still need to use a null terminating character even in unicode

#

ANSI C and C at C99 standard neither use unicode, they are ascii-only but they can include unicode implementation through libraries and bit banging

long raft
#

this does not make sense

#

it was easy to use string libraries that support unicode in C before 1999

#

there is no string object in C, as you know

#

it all depends on which libraries you use

fickle aurora
#

string libraries in C were limited to ascii, if you wanted unicode you had to use a whole different set of libraries

long raft
#

modern string libraries dont use zero termination because its slow

fickle aurora
#

the old CPUs often have trouble because they have small address buses

#

they were all ascii based before the 90s

#

heck there is even a 5 bit character table that pre-dates ascii

long raft
#
typedef struct derps_string {
   int length;
   ushort * data;
}
#

thats how a modern string object would work

#

or even better, int * data

fickle aurora
#

that is your 5 bit character table, how lovely, does not even have punctuation markings in it

#

well, paragraph symbol anyway and the other ones like that

#

data is a pointer to an address in your string example

long raft
#

when you grow up in an age where int changes size over the years, you realize nothing in C is nailed down, everything is just a convention

fickle aurora
#

any time you use * you are pointing to an address location

long raft
#

when i was a kid, an int was 16 bits

fickle aurora
#

that is entirely dependent on the platform

long raft
#

its dependent on the compiler

#

but i suppose word changed size too on me

fickle aurora
#

it's not a compiler thing, it's platform, as in the CPU architecture and whether 32 bit or 64 bit OS

long raft
#

im so tired of arguing

#

i just have to let go if you believe these things

fickle aurora
#

to understand data types and how they work you first need to refer to your CPU's reference manual, in this case I copied this from Intel

#

a CPU does not know what a character is, all characters are stored as integer values, thus this is why char is often going to be smaller than integer because a char is a smaller number generally

#

a lot of what I work with is low level as you can imagine I literally just program microchips, that's as low level as you are going to get, so for me, efficiency is everything - if I am doing something inefficiently, I will run out of program memory or even volatile memory if I declare too many global variables for example

#

software developers don't have to worry much about it because personal computers have so much memory in them you can practically run the earth on your smartphone if all the systems in the world were programmed for pure efficiency

long raft
#

ive wired my own computer with jumpers and transistors

fickle aurora
#

here is a great experiment for you; make a C hello world app and a C# hello world app, run each one and see how much CPU clock time and memory each one use

long raft
#

why

fickle aurora
#

the C# version will use at least several megabytes of data in memory, even if it should only use less than 1k

long raft
#

i've got one. make a hello world program that works with utf8

#

youre just making up a test thats super obvious, we dont even need to test it

fickle aurora
#

so you can admit C# is bloatware, at least that much we can agree on

long raft
#

these are tired arguments

#

if C was so perfect, why did people keep making thousands of new languages for the next 60 years

fickle aurora
#

if C was not perfect, why is it still being used today? how come microchip isn't using C# by now?

long raft
#

so anything being used today is perfect?

fickle aurora
#

I am surprised no one here corrected me when I stated that C was made by Brian Kernighan, though he did write the first manual on C, it was actually Dennis Ritchie

long raft
#

i got tired of correcting you, i asked where you got your facts

#

and i think his contributions to C++ were minor

#

but i think people who make very popular languages are not zealots to only their language

fickle aurora
#

C was invented in 1970 on a computer that had flashing lights instead of a big monitor screen, ironically, it never became an obsolete language

long raft
#

when you read interviews with them, theyre clearly borrowing the best parts from all the things they admire

fickle aurora
#

C# will eventually die off, it will be replaced and C will still be here

#

the only thing that kept java going really was android and oracle

#

I wanted to bury java in 1999 and never see it again

#

python is going to last quite a long time, though I don't use it

#

the quadword can also be a regular double, or a long on 64-bit only

#

and this is why I say it is really nothing to do with compiler as it is how the CPU handles the data, that is why 32 bit and 64 bit have completely different ways of storing data types and why they are incompatible (however intel has backward compatibility to 32 bit but this is not always the case in every CPU manufacturer)

#

typical data size chart, it doesnt matter what compiler you use or what operating system you use, it is entirely platform dependent, though this chart does assume you are either using AMD or Intel, however, there are other CPU manufacturers that have different ways of storing data where this table would not be relevant

long raft
#

none of this makes me wrong

#

you just wrote on top of a chart... i said the compiler defines it, and then you confirm that by writing the compiler definitions on it

#

dword is not just another word for int. only because the compiler says so

#

frankly, thats not even true. a dword would be a uint

#

it can be either, right?

fickle aurora
#

well I am trying to put together a way to explain this easier for you, because there is a reason why 64 bit data types often use the same byte count as 32 bit and it has to do with intel splitting the CPU registers in half on 64 bit to allow you to access the Exx registers even though the new 64 bit registers are all Rxx

#

AMD does the same thing, well, because intel uses AMD's original 64 bit architecture

long raft
#

you dont have to explain it, i know already

#

but im also telling you i know that the compiler defines what an "int" is

#

not intel or amd

fickle aurora
#

to be honest most of what they write in there is only useful to an engineer designing a new motherboard (me in 10 years?!) or for someone making their own compiler (long project in the works on the backburner)

#

if all you do in your day is make websites, I think a lot of this is irrelevant to you anyway probably

#

RCX is of course, as you might have guessed, a 64 bit register where ECX is a 32-bit register, as I explained where Exx is 32-bit and Rxx is 64-bit, however they are really the same register; RCX is split in half, and one half is ECX

#

these two registers are where the CPU matches a null termination character to validate a string

#

who would have thought a CPU did math analog style? the universities won't teach you this, no, it's just hidden in the Intel Architecture bible...

#

and yes, before people start jumping on me over calling it analog, the only way, the only way to measure resistance is with analog and then you have to do analog to digital conversion again to get the digital signal - still, this is great knowing that Intel uses analog for math

fickle aurora
#

I don't normally post memes.. like extremely rarely, but I feel this is extremely relevant

kind glacier
#

lol really?

long raft
#

the universities wont teach you this
they literally teach you this. its like a junior level class in cpu architecture

pure sierra
#

i started uni, but once i worked out how calculators did math and that cpu was just that to the crazy nth degree, i was like, im done, out.... and dropped out to try and change my life direction. it worked somewhat, but i ended up in self tought web programming instead....

kind glacier
#

It's a lot of black box for me

#

code goes in, syntax error comes out

languid harness
#

It isn't that hard

#

You just write what you want and give it to someone who knows better

coral sundial
#

Ditch the calculator and do the math yourself

languid harness
#

Fuck modern technology

#

get that scissor and paper out, time for punch cards

coral sundial
#

Lmao

#

when you make your code look like arduino IDE, but its actually overcomplicated C avr code to sequentially toggle 4 leds

#
#include <util/delay.h>

#define INPUT 1

#define LED_DDR DDRB

#define LED_PORT PORTB

#define LED_1 PB5
#define LED_2 PB4
#define LED_3 PB3
#define LED_4 PB2

void Toggle_LED(int Led, int state)
{
    if(state == 1)LED_PORT &= ~(1<<Led);
    if(state == 0)LED_PORT |= (1<<Led);
}

void Pin_mode(int pin, int pinmode)
{
    DDRB |= (pinmode<<pin);
}

int main(void)
{
    int LED_array[] = {LED_1, LED_2, LED_3, LED_4};


    for(int x = 0; x < 4; x++)
    {
        Pin_mode(LED_array[x], INPUT);
        Toggle_LED(LED_array[x], 1);
    }


    while(1)
    {
       for(int x = 0; x < 4; x++)
       {
           Toggle_LED(LED_array[x], 0);
           _delay_ms(500);
           Toggle_LED(LED_array[x], 1);
           _delay_ms(500);
       }

    }


    return 0;
}```
#

I still have to find a way to pass the data register for Pin_mode. so far my attempts havent worked

fickle aurora
#

my whole C code ported to assembly, so no libraries were used for it and it works exactly the same

#

Rem, it's not the same as arduino because arduino uses a special bootloader to load sketches with, whereas if you program it in atmel studio, your code is instead made into hex directly and your program becomes the whole firmware

#

with arduino, you have to use ICSP to first burn firmware bootloader, then you can upload sketches simply with TTL logic using a USB serial to TTL converter and that uses entirely different pins and different communication protocol

#

with Atmel studio or anything else really, you instead make your whole program right into firmware and you upload it with ICSP, you never need to use serial to TTL

#

also, arduino can't use the advanced features of the CPU such as low power modes, sleeping with interrupt pin enable, disabling/enabling ADC to save power, etc and arduino fills up half of the program memory with a useless bootloader

#

you can't even put arduino sketches on ATtiny10 which is what I made this program for - why, well, because the arduino bootloader is too big for this little tiny CPU

#

the problem really with assembly is that you have to type a bit more stuff than if you simply use C, here's the kicker, so before storing values out to configuration registers, the datasheets explain that we should first move all the values we want to store into all the general purpose registers first, then move them over

#

the problem is that when you send an output, it doesn't synchronize right away because remember that a CPU has a clock and each tick is when something is performed, so you need to use NOP to allow for that sync to happen, otherwise it will keep trying to pull data off the bus

#

you could theoretically follow each LDI with the corresponding OUT, but then you need to follow it with NOP, so that means in my code I would have like 8 or so extra NOPs that don't need to be there

#

of course, every CPU ISA (Architecture or Platform) has a different instruction set, so those commands will be different on other CPU arch

#

someone might be wondering, well, why did I use R16 twice for my outputs in the config section - well, I needed to store b1100 into 2 configuration registers - so the NOP was not needed necessarily in this case because synchronization is not needed to retain the same value in R16, so long as I did not try to modify the value in R16 before the next NOP instruction

#
; in both DDRB and PUEB due to the fact that
; we are not allowing the CPU to synchronize
; between changes in value of the R16 Register
;
  LDI R16, 0x0C ; 0x0C is binary value of 1100
  OUT 0x01, R16 ; 0x01 is DDRB Config Register
  LDI R16, 0x08 ; 0x08 is binary value of 1000
  OUT 0x03, R16 ; 0x03 is PUEB Config Register
  NOP```
coral sundial
#

@fickle aurora I said ''look like'' not that it is arduino. I dislike the platform precisely those reasons

pure sierra
#

@fickle aurora there is a low power library that gives you all those functions. im currently working on a 328p project that i program with icsp as i have a bt module permanently hooked up to serial0

fickle aurora
#

yea, you should be able to inject assembly code as well, though I haven't tried that on arduino so I don't know if it is possible

pure sierra
#

you talking about low power ?

fickle aurora
#

yes

#

I like arduino for prototyping quickly, but the thing is once you have it your best bet really is to bring it to atmel studio and start porting it for efficiency

pure sierra
fickle aurora
#

or you could simply just write it in atmel from the start

pure sierra
#

id say if u arent running out of space theres little need to port

fickle aurora
#

the thing is that the arduino bootloader firmware is always going to eat power

pure sierra
#

doesnt matter if not running off battery, also can use arduino ide and program via iscp without bl

coral sundial
#

bruh just learn C its eeazy

#

can I program arduino's with holyC?

#

oh lord please let it be

fickle aurora
#

which compiler are you using in arduino

coral sundial
#

me?

fickle aurora
#

hayden

pure sierra
#

the ide

fickle aurora
#

the atmel studio has a lot in it to help port arduino projects to atmel studio and I think XC8 compiler for 8 bit CPUs is free

#

the default in arduino is avr-gcc so it is technically C

#

it isn't to the proper C standards that were set long ago though, so it is more like C++ that emulates C

#

however if you wanted a proper low level C compiler, the XC8 compiler follows the C99 standard

#

the problem with these GNU tools is that they are open for anyone to contribute to them, so they always move away from the set standards and by doing that, they introduce problems (which could be security problems, emulation bloat, or just plain bad code)

#

this is exactly what sets GNU apart from BSD licensed projects, so BSD licensed projects for example, in most cases, are restricted to developer teams that are lead by a lead programmer who is often very well educated in combing through the code for problems

long raft
#

its nothing like C++

fickle aurora
#

another great example is Linux versus OpenBSD... yeah, Linux has far more features, but it also has some very major security holes and instability that requires constant patching to fix them... openbsd on the other hand has a lead developer who decides what code can be submitted to the project and it has been around for decades with only a handful of bugs

long raft
#

i dont understand this vibe that because its a 20 year old standard that its somehow lower level

#

oh no, youre crossing into my holy land of BSD. must restrain my ree

#

linux also has a lead developer that decides what goes into the kernel

#

and as much as i love bsd, it seems on the surface bsd security is not as tight as linux because of testing, they are similar

fickle aurora
#

I would love to see what theo de raadt would say to that

#

he would probably give a 3 hour lecture explaining on a machine code level exactly all the security holes linux has, and the fact the teams know about the problems for decades and have never bothered to fix them

long raft
#

im not a big openbsd person specifically, but i think theres plenty of evidence of security holes in it

#

i personally find it concerning that security and quality come down to just a handful of individuals at least with linux and unix, i surely hope its not the same way for osx and windows

fickle aurora
#

microsoft does a good job on it, the problem is that because they are so powerful, governments force them to add backdoors for intelligence agencies and those backdoors are where the majority of the security problems are

long raft
#

you have any evidence of that?

#

ive never seen that shown once with windows or osx

fickle aurora
#

I don't have evidence of it, but there are others who can point out the blatent security holes to microsoft and those holes never get patched up

long raft
#

failure to fix bugs is not the same thing as introducing back doors on purpose

fickle aurora
#

ironically, the same thing is true when theo points out the security holes in Linux

#

why would MS outright admit to putting in backdoors, that would be bad for PR

long raft
#

of course they wouldnt, but that doesnt mean they wouldnt be found

fickle aurora
#

so do you think stuxnet never happened?

long raft
#

if you assign every bug as a malicious security hole, theres no real way to falsify that kind of thinking

#

stuxnet was a virus. if they had a backdoor they wouldnt need to write a virus

fickle aurora
#

a backdoor is essentially a transmission conveyance for a virus to use

long raft
#

or its just an unknown vulnerability

#

theres so much evidence that the us government does not have back doors in

fickle aurora
#

stuxnet was proof that even in the microcontroller world, big companies that are normally trustworthy - in this case siemens - are not on top of security (though they have huge teams of PhD level engineers) to the point that it was pretty obvious there was a backdoor built into siemens controllers to allow a virus to be transmitted in, even if it requires local access to do it

long raft
#

make up your mind, was it an oversight or did they put in a back door on purpose?

#

back doors are not exploits, theyre intended

fickle aurora
#

we will never know

long raft
#

but the evidence suggests it was not a back door

#

and the virus spread beyond the iranian centrifuge facilities and went wild on the internet

#

some more evidence that it wasnt well targeted like a back door would be

fickle aurora
#

the problem is SCADA does not normally allow for a computer to send data to a microcontroller, because that would put all major infrastructure at serious risk

#

it is normally only read-only data

#

automated systems that make the controllers work are literally never connected to the internet

long raft
#

evidently their network wasnt severed, or somebody introduced it

fickle aurora
#

in fact they arent even compatible, they use RJ45 plugs for RS485 which would blow your ethernet card if you plugged it in

#

it was introduced locally according to the wiki on stuxnet

#

someone had compromised it with local access and likely some USB stick

long raft
#

i think im more concerned with single programmers being buyable than an entire company

#

minix worries me more than anything else for potential backdoors

#

but if anyone ever discovered an intentional backdoor in say an intel chip, intel would be a dead company

fickle aurora
#

well here's the thing, especially for people such as yourself who think china is stealing tech from us... the CEO of Nvidia is a chinese guy... the CEO of AMD is a chinese woman... no, they didn't buy in - in fact, Jenson himself founded Nvidia corporation

long raft
#

what? why are you putting words in my mouth?

fickle aurora
#

well because of what you said before, it sounds like you blame china, but I am saying that they literally founded their companies, they didn't steal anything

long raft
#

i would point out lisa su is taiwanese, i think if you believed everyone born in mainland china was a spy, she still wouldnt be included in that

#

but shes american, not chinese

#

what did it sound like i blame china for? i dont even remember saying china in months

fickle aurora
long raft
#

oh i did say that. well thats factually true isnt it?

fickle aurora
#

not really, because C is used by thousands of people and not all chinese

long raft
#

china is doing the majority of work in micro controllers, no?

#

and driver programming

fickle aurora
#

they are doing the majority of work in everything

long raft
#

nah i dont thikn so

fickle aurora
#

not enough people in north america are interested in programming at the CPU level

long raft
#

yah, agreed

#

i mean i wouldnt say "enough" because its clearly enough

#

but less people in north america are interested in that

#

i also dont see it as a problem, this is why i was confused when you suggested i think china is stealing tech or a problem

#

theyre definitely stealing tech, but i dont think ive ever brought that up

coral sundial
#

they are doing the majority of work in everything
@fickle aurora well with over a billion in population i dont think its that weird that they van do work in everything

long raft
#

i mean they arent

fickle aurora
#

we are overregulated here, that's the real big problem

long raft
#

chinese nationals are doing like UI development for the world

#

and frankly embedded device programming is an easier area of development in computer science

#

it doesnt require a lot of language skills or mathematics

#

i mean its still hard, dont get me wrong

fickle aurora
#

afaik electrical engineering level of programming uses far more mathematics than software development

long raft
#

the programming? no definitely not

#

the physics of the hardware at most might use calculus

#

but the programming is basic arithmetic

fickle aurora
#

what math you use for parsing strings? you need to do bit level stuff for that?

long raft
#

yah thats just simple math

#

adding and multiplication, thats very basic math

fickle aurora
#

bit level is entirely different

long raft
#

its not different...

fickle aurora
#

try doing EE bit level math all day long and tell me it's not math intensive

long raft
#

why do you assume i havent done this?

#

i have. and its not math intensive

fickle aurora
#

software dev has it easy man

long raft
#

game programming is math intensive

fickle aurora
#

yes but few people make games

long raft
#

the game industry is huge

fickle aurora
#

in fact colleges are separating those job titles because most people can't do math

#

but in EE literally at the bit level, literally everything is math

long raft
#

yes, but its very easy math

fickle aurora
#

digital logic math to compute trigonometry is easy?

long raft
#

you know you can take someone's high school math level and teach them EE development

#

yes, thats relatively easy

fickle aurora
#

can you explain how I multiply a number when my CPU does not have division or multiplication instructions

long raft
#

i know the development of embedded stuff is still difficult, its just not math heavy

#

yea you just multiply the numbers like you learned in 4th grade

fickle aurora
#

and division?

long raft
#

long division just like 4th grade too

#

i mean thats what americans call it, long division

fickle aurora
#

it's quite a bit more complicated than that

long raft
#

its not, i have done it

#

i mean long division itself is complicated, because there are so many steps

#

but its basic arithmetic

#

its just in binary

fickle aurora
long raft
#

its like solving puzzles with a few pieces

#

but it doesnt require 5 years of math background, thats my point

#

i remember doing it at 15 years old, long before i knew any complicated math, so ...

#

i think the physical properties of the chip are a lot more complicated than the programming for it

#

you know designing a chip like that is extremely complicated, but i think they can get cheap labor to program them

fickle aurora
#

the cheap labour is all in software dev because it's easy

#

if you want to make money these days it's all in EE, but it's not easy

long raft
#

you know ... 1 programming language?

#

and you think software development is easy?

#

have you ever made a program more than a thousand lines of code?

#

like you mock web development, but web development is like 50 different technologies, its massive

fickle aurora
#

sending commands to sql is hard?

long raft
#

About as hard as boolean math

#

Obviously web development is a lot more than writing to a database

fickle aurora
#

if you mean making the web server, yeah that is a bit of a project

long raft
#

Not really, a web server is just 1 protocol out of like 20

#

I mean a single web page uses a ton of different technologies, there's a lot to learn

#

Most of it is easy but there's tons of it

fickle aurora
#

probably IIS is made in C, though I don't know, but Microsoft has said before that Windows is primarily written in C and C++ with some routines hand made in assembly

long raft
#

windows is made primarily in delphi

#

or at least it used to be...

#

i mean its obviously a mix of languages

#

dunno whos using IIS these days...

fickle aurora
long raft
#

ya the apis are mostly C

#

kestrel is a faster web server than IIS and is written in C#

fickle aurora
#

the API is quite literally the OS in this case, since all the functions of the OS are of course made from the API

long raft
#

i see no real value in developing user-space applications in C

fickle aurora
#

a web server in C# is a horrible idea lol

long raft
#

i just looked it up, IIS is c++

#

youve got a very narrow view of how things can be or should be done

fickle aurora
#

servers need to be efficient because you have many hundreds of people accessing it

long raft
#

it is ...more efficient than IIS

fickle aurora
#

it can't be more efficient

long raft
#

managed languages are especially "efficient"

fickle aurora
#

C# code is not possible to be more efficient than C++

long raft
#

well it is, actually

#

if you look up memory allocation, c# destroys c++ or C in that

fickle aurora
#

just like C is not possible to be more efficient than Assembly

long raft
#

you can find areas where some languages are better than others

#

i would guess if you wrote a program in C it will be compiled faster than if you programmed it in assembly - because you are not as good at assembly as the C compiler is

#

and if IIS was the fastest web server, and kestrel is faster... (i know it has less features)

#

but it would seem to me that a web server written in c# is faster than the previously fastest one in c++

fickle aurora
#

you are better off getting apache for windows

long raft
#

and i dont think any c# programmers or java programmers are trying to achieve speeds of something carefully written in c++, but they also consider their time more valuable than wasting weeks for an extra 5% speed

#

apache is a very slow web server

#

i think you just always side anti microsoft because you dont know anything about it

fickle aurora
#

apache is slow? compared to your C# web server? lol

long raft
#

a lot slower.

#

everybody knows this

#

apache is famously like the slowest major web server

#

<<<
Kestrel is built to be fast.
When tested on Windows Server 2012 against IIS and at a pipeline depth of 16, Kestrel pushed 1,188,521 requests per second compared to IIS' 57,792 requests per second.
<<<

#

and IIS stomps nginx and apache and even lighttpd too

fickle aurora
#

are you testing multiple threads?

long raft
#

not my test, you can just find tons of benchmarks of kestrel

#

they absolutely wreck the competition

#

and hey its open source and cross platform

fickle aurora
#

apache runs several separate processes because it is multithreaded

#

it is like a modern CPU in that it will connect users to threads in a way to load balance them

long raft
#

i dont think it matters

fickle aurora
#

I doubt a C# web server has this capability

#

yes it matters in a very huge way

long raft
#

if this benchmark is believeable, and kestrel is 20x faster than IIS which is like 2-10x faster than apache...

fickle aurora
#

load balancing with a server is a very big deal

long raft
#

you doubt c# can multithread? youre kidding i hope

fickle aurora
#

yes it can but it depends on the developer

long raft
#

see you cant believe because you believe the myth that managed languages are always worse

#

but youll be stuck in the 1960s forever

fickle aurora
#

C# is also inherently slow and memory hogging which is why you would never use it to write a server side program

long raft
#

see, but obviously thats not true

#

you just cant change your mind when confronted with evidence. this is a bias

fickle aurora
#

it is good for client side because client side only handles data on one single user

long raft
#

you wont grow as a developer if youre prejudice like this

#

yea these are good benchmarks actually

#

but hey, you are welcome to just keep believing apache must be better even though its not

fickle aurora
#

any network operator would laugh like crazy if you suggested to them to replace apache with this C# web server

long raft
#

i dont think you know many network operators

fickle aurora
#

if I couldn't use apache the next thing in line I would use would be maybe IIS but that's all

long raft
#

theres no reason to be using IIS these days

#

running a windows server, cmon. thats crazy in 2020

fickle aurora
#

I thought you liked your C# interactive web pages

long raft
#

i like c# for web development. i can do that on linux

fickle aurora
#

IIS is best at that

long raft
#

i just told you its not

#

i just ... showed you the benchmarks

#

you are a dinosaur

pure sierra
#

apache is good because its popular and common

long raft
#

it is good. but not fast.

#

fast web server not very important anyway, just an example of c# beating c++

#

with better security, too...

pure sierra
#

ive used nginx for a while, but bit difficult as beginner getting web apps with htaccess config and having to translate it. in the end i just upgraded my vps and switched back to apache

long raft
#

i learned nginx first, so i actually find it easier than apache, but theyre both rather awful

#

the configuration format is honestly horrible, some of the worst ive ever seen

#

nginx is almost like a C style format, but not. and apache is almost like xml but not

fickle aurora
#

the thing is a real web developer needs about 5 different things before they can really be a real web developer - you need a webserver, DNS server to manage your own domains, outgoing mail server, incoming mail server, and mail delivery server to manage individual mailboxes (iirc Microsoft combines all mail server functions in Outlook into one program)

#

if an apache configuration file is too difficult to manage, I don't recommend being a web developer

#

just with bind, you will have to learn so many things about the DNS protocol, and then there's DNSsec you have to deal with, and then you have to go through a process with all the major mailservers, such as Google and have them allow your mailserver to send mail to gmail accounts for example, and they require you to set your server up a certain way for that as well

#

so you need to register with Google as a Bulk Mail Sender for example if you run your own mailserver, and you have to agree to monitor it for hackers who might break in and use your server to send spam - if your server is marked as a spam sender, they will blacklist you with hundreds of companies mailservers and then yours is practically worthless

#

by default, google will block attachments you send to a gmail account from your mailserver - you have to apply for the Bulk Mail Sender program and you can get a special status which accepts certain sized attachments to go through, also your mailserver must be SSL on server side, if not they will block anything you send, and they also require your DNS server to be verified as well, so you have to be running DNSsec

#

don't assume you will never be a target for hackers - most of them now are no longer people - they are AI scripts which connect to random IP addresses on the internet, and they keep poking their fingers in your protocols until they find something they can exploit - and this happens in seconds, it's not like in the movies where flashing lights and warning alarms go off - most of the time you don't know it happened until long after

pure sierra
#

i just use virtualmin and it does it all for me, nearly

fickle aurora
#

now also to add to DNS.. DNS is such a huge thing apart from all this, so you can manage your own zone file for your domain name but this is not enough - you also need to set up the DNS server to be able to communicate with slave DNS servers, usually your data center will have several servers that they offer for slave DNS service, now getting these servers talking to each other is a dreadful process sometimes but you can do it

#

yes those GUI administration kits are basically no different from a rootkit with a big sign telling the internet you are looking for some fun

#

maybe virtualmin is better than what I think it is, but I can remember how bad Cpanel was long ago and since then I swore never to use a GUI for administration ever again

long raft
#

but even the most basic web development is going to be like 4 languages

#

theres countless conventions youve got to learn, its data and model and presentation all together, it takes a huge range of knowledge to be good at

fickle aurora
#

so this is a test I wanted to show you, what it does is prove what I stated about memory management in C a while ago - the null character's memory address can be pulled using this code and shown on the screen... there is always the main string pointer address and then the character array in the string has chronological memory addresses

#
#include <string.h>

int main (int argc, char *argv[])
{
  int i = 0;
  if (argc < 2)
  {
    printf("%s:Command not executed. Format: %s <value>\r\n", argv[0], argv[0]);
    return -1;
  }
  printf("Entered Value: %s\r\n", argv[1]);
  printf("String Memory Location: %d\r\n", &argv[1]);
  for (i=0;i<=strlen(argv[1]);i++)
  {
    if (i < (strlen(argv[1])))
      printf("Character Memory Location (%c): %d\r\n", argv[1][i], &argv[1][i]);
    else
      printf("Character Memory Location (null): %d\r\n", &argv[1][i]);
  }
  return 0;
}``` and here is the codeblock if you want to copy paste it
long raft
#

i dont know what to say. i agree thats how string.h works. i'm not sure what that has to do with the processor

#

because that library was written in the 70s

fickle aurora
#

this was probably re-written after 2000 because it's a library in GNU C++

long raft
#

C designer Dennis Ritchie chose to follow the convention of NUL-termination, already established in BCPL, to avoid the limitation on the length of a string and because maintaining the count seemed, in his experience, less convenient than using a terminator.
not because of how CPU interrupts work

fickle aurora
#
Entered Value: testing
String Memory Location: 11865380
Character Memory Location (t): 11865448
Character Memory Location (e): 11865449
Character Memory Location (s): 11865450
Character Memory Location (t): 11865451
Character Memory Location (i): 11865452
Character Memory Location (n): 11865453
Character Memory Location (g): 11865454
Character Memory Location (null): 11865455

C:\Users\Allan\Documents\Test>``` So this was what I generally get, if the null character did not exist in memory, I would have instead crashed the program by trying to call an array out of index
long raft
#

because you made it that way

fickle aurora
#

I literally pasted the source code for you to try it out

long raft
#

this is an alternative C library for strings that does not use null termination

#

you made it use zero termination because you chose to include string.h

fickle aurora
#

it calls &argv[1][i] I didn't add the memory address in a fake way, it is literally linked with %d in the code

#

I did add the "null" to the text part because otherwise you would just see a blank character

long raft
#

none of this is a requirement of the CPU

#

this is just how C does strings by default

#

its not a memory management thing, its not "direct memory access" or whatever you mentioned before

fickle aurora
#

well there is one OS which does not use null termination, that is MS-DOS

long raft
#

no it doesn't. ms dos uses $ termination

fickle aurora
#

in fact, MS-DOS uses $ as a string terminator

long raft
#

thats just the default interrupts, you dont have to use them, and the C libraries dont

fickle aurora
#

everything else uses null character, even MS own API states you need to use it if you build character arrays and want to convert them to strings

long raft
#

no it doesnt, lol

#

their API uses zero termination, yes, but "everything else" doesnt

fickle aurora
#

the specifications also call for Carriage Return & Line feed for Windows, which is Microsoft-compliant whereas Linux/Unix often only uses the Line feed character

#

there's a reason these standards have existed for so many decades

long raft
#

because of typewriters?

fickle aurora
#

well, because... they are standards

#

some people parse files based on standardized things

long raft
#

thats fine. its not a CPU thing

fickle aurora
#

if I parsed a file based on \r\n and the file only used \n, there would be a problem

long raft
#

in the same way cpus dont understand unicode...

fickle aurora
#

similarly, if I parsed only \n, then there would be a \r character everywhere

#

standards exist for these reasons, so we can follow some semblance of a standard

long raft
#

ok, im not even sure .. what we're talking about

fickle aurora
#

of course, I can solve the Windows/Unix problem simply with definitions, like #define win32 or something

long raft
#

are you going to walk away thinking the CPU requires you to have zero at the end of a string?

fickle aurora
#

so like #ifdef <windows> #then <parse token for windows> #else <parse code for Unix/Linux/Mac>

long raft
#

you know, now that im thinking of the windows API, i dont think even that uses zero termination, most libraries require you specify the string length

#

for interoperability with languages that dont use zero termination

fickle aurora
#

it does

#

if you read the API on Microsoft's knowledge base, all of that is there

long raft
#

yah they did, ok

fickle aurora
#

they are trying to make it easier in C# by doing the null termination by the compiler so developers don't have to worry about it, but if you work with memory directly, you will see it there

long raft
#

it's not all that common anymore

#

you have to quit saying that, when i work with memory directly

#

i dont think you know what that ...is

#

youre making up some distinction between it

#

if i wanted to pass a string to a C api from C#, i would simply pin the pointer (so it can't be moved in memory) and pass the pointer to the first character

fickle aurora
#

the concept of stack/heap is also becoming really confused by newbies entering the field of computers, and it is really hard to fix the damage that the internet causes by misleading people on all the new programming languages that hide the ugly code and make everything easy for people

long raft
#

the only thing that isn't "direct" is that its using virtual memory, the same way it would work in C

#

theres no confusion in c# between heap and stack. structures/primitives are allocated on the stack, and reference types (classes) are allocated on the heap. its very clear

fickle aurora
#

for the most part, Microsoft worked really hard to make memory management easier for people in C# but there are still some situations where if you do something out of standard that one would not expect someone to perform, it causes major issues with memory

long raft
#

equally clear with c++, it uses new

#

yes memory management in general is better though

fickle aurora
#

quite literally, if you do something out of the box, you will break your program in C#

long raft
#

its more efficient overall

#

i mean thats not true, its obvious you dont know about c#

#

out of the box? lol

fickle aurora
#

with C there is so much more flexibility but you are required to manage every bit of memory manually, there is nothing automatic in C

long raft
#

i think you mean "unsafe" or unmanaged. its very easy to work with fixed memory

pure sierra
#

@barren quarry we need a new channel, #architype-talk

long raft
#

you see this as a disdavantage, or easier, but this is modern stuff for security

#

i dont see this as some argument over which language is better. i know them both

#

different use cases...

fickle aurora
#

basically what hayden is saying, is that the proof I came up with by writing source code to test and show how string pointers work in memory should be hidden from public view because it goes against popular opinion

pure sierra
#

im not saying anything

long raft
#

its not a "popular opinion", its fact

pure sierra
#

just that ive been using virtualmin for years and never been hacked

long raft
#

nobody is hiding strings tho

fickle aurora
#

well let's see, I'm the only guy here who put code in chat in the past few days...

pure sierra
#

its the web apps that get you hacked

long raft
#

this is a moot argument whether doing it is a good idea or not - because nobody is doing it

#

you are definitely not the only one to put code here, but ok

#

youre changing your argument and then you say see it makes you correct

fickle aurora
#

I think people who are looking at the chat right now would rather side with the person who can actually write code and has demonstrated this ability

pure sierra
#

actually its normally pretty quiet in here until recently so i made it ping notify me on all messages, i had to turn that off this mornining after my computer turned itself on in the night and started pinging like crazy for hours at about 3am this morniing my time

long raft
#

oof sorry hayden

#

i dont know why i care about it

pure sierra
#

its not ur fault, happy to see u use it , even if i dont really folow it all

long raft
#

arguing about some stupid inane shit about c libraries lol

pure sierra
#

can we summarize this massive debate in a tldr ?

long raft
#

he thinks C is low level, "direct" access to memory, has all these ideas about how CPUs work that it doesnt

fickle aurora
#

I already summarized it by showing proof of how string pointers work by writing the code to test and display the output

long raft
#

thinks C is always faster and better than everything else, thinks software development is easy compared to embedded device programming

#

lectures me about how C works... stuff i already know

#

then i tell him ive got a billion years of experience, i know this stuff deep, then he lectures more about it

#

its because i dont wanna play game, i want to play discord ๐Ÿ˜ฆ

#

your code is fantastic, @fickle aurora, i plead you read this, its short: https://en.wikipedia.org/wiki/Null-terminated_string

In computer programming, a null-terminated string is a character string stored as an array containing the characters and terminated with a null character ('\0', called NUL in ASCII). Alternative names are C string, which refers to the C programming language and ASCIIZ (althoug...

fickle aurora
#

wikipedia is often wrong because they allow too many people to access it, you should use encyclopedia britannica to cross reference information

long raft
#

Feel free

#

I have no doubt they will be the same

fickle aurora
#

britannica is nowhere near the same

long raft
#

I don't think you will disagree with anything in it

pure sierra
#

"lets use a c diff lib to do that" ;p

fickle aurora
#

where wikipedia will have one page of data on any particular subject, britannica will have 50-1000 pages on every subject and more links to sources, as well as re-typed pages from books that are no longer in print

#

before britannica was on the Internet, they had massive libraries of books and that is where most of their data is from

pure sierra
#

"encyclopedia britannica" - me thought it died some years ago coz the net

fickle aurora
#

I will admit the majority of wikipedia is good information

long raft
#

its called "unsafe" because its unsafe like C

#

its still portable, it compiles to native code

fickle aurora
#

unsafe does not mean insecure, it means you need to know what you are doing

long raft
#

yah like guns arent unsafe, you have to know what youre doing. i think we could agree we could call them dangerous

fickle aurora
#

this is why C is not recommended for new people, but to be honest, you don't really understand programming until you can master C

pure sierra
#

same thing

#

programming is a spectrum like anything

long raft
#

C is great knowledge to have. its also very easy to learn

#

some people struggle with pointers

pure sierra
#

you just learn what you need to

long raft
#

theres a lot of convention to learn, but the language itself is small and easy

pure sierra
#

there are a lot of applications where speed is not really a concern, even a 'slow' language will run more than fast enough with the often excessive amounts of processing power available... even at 4mhz...

long raft
#

i for one prefer the challenge of logic rather than compiler minutia and re-inventing the wheel for every process, i dont think programming focuses around C as programming existed long before C did

#

but it feels like getting caught up in the masonry rather than the architecture

fickle aurora
#

yeah, before C there was assembly

long raft
#

there was pascal

#

fortran, cobol

#

a hundred other languages

fickle aurora
#

those did not come before C

long raft
#

they absolutely did

#

fortran is like early 60s

#

you thought C was the first high level language?

#

even BASIC was before C

fickle aurora
#

cobol is definitely not made before C

long raft
#

1959

fickle aurora
#

wikipedia makes that claim but if you read the old books you will see

long raft
#

over a decade before C

#

the language is freaking called COBOL-60 lol

#

you think thats just wikipedia making that up?

fickle aurora
#

it's the same as all these people saying there were computers in the 1400s because someone made a sand hour glass once

long raft
#

lol what

#

this is nothing like that.

#

you thought C was first, its not. its not even close

fickle aurora
#

they were all working on better languages in the 1960s

#

doesnt mean they were all available to everyone in the 60s

long raft
#

as much as C was

#

i mean if you cant even concede historical facts, what are we doing

#

ill go shoot some wardens

fickle aurora
#

wikipedia is putting the date of when those languages were becoming a thought in someone's mind

long raft
#

theres a picture of the instruction manual

pure sierra
#

@long raft come join wardens

long raft
#

yah next war

pure sierra
#

stay forever

long raft
#

every time i join colonials i lose

#

actually i cant commit to going warden yet. population is too broken

#

i have a lot of colonial friends now

#

i feel bad for them...

pure sierra
#

i think some crazy shit went down lastn day

#

collies made a big push back

long raft
#

rreally??

fickle aurora
#

you know, wikipedia also states C is from 1972, right? my book on C written by Dennis M Ritchie literally says it was developed in 1970

pure sierra
#

i think it failed

#

but all of deadlands th got destroyed at one point it went so far

long raft
#

i see ... nothing

#

foxholestats looks the same as last night

#

theres no big comeback, dude.

pure sierra
#

coz it failud

long raft
#

seryll says 200 warden advantage last night

#

says they counted

#

classic foxhole snowball, we are allergic to even teams, always have been

pure sierra
#

what do u mean we are allergic too it ?

long raft
#

even before WC, vets hopped servers to play the one they had an advantage on

#

never play against each other, always play past each other

#

so theres like always 1 faction now thats oversized, because we cant just change servers and stomp

#

we take turns taking breaks now

pure sierra
#

sure, i remember servers where the wardens would just get stomped game after game, day after day because no one wants to join a loosing team

#

(b4 wc)

long raft
#

it just looks different now

#

but basically every war 40% of the people had a bad time

pure sierra
#

one way they could approach the issue to make it really persistent not fake peristent, so the war never ends. there is no winner, no looser

long raft
#

wed need a way to change teams

pure sierra
#

and if u have a team getting stomped over time it gets more and more advantage to break out

fickle aurora
#

well if foxhole servers are written in C#, that makes sense why they can't handle more than a handful of players per server

long raft
#

it would be a grind tho after like 2 months of that hayden

pure sierra
#

its got nothing to do with c, its a net limitation

#

afaik

long raft
#

dude C is his golden hammer

fickle aurora
#

if they see the light and start rewriting a better server side implementation, it will be such a great game

long raft
#

i dont know what their server is written in, i suspect c++

#

theyre c++ coders

fickle aurora
#

the limit you are thinking of is actually the open files limit

#

by default I think the limit is like 1024 connections

long raft
#

no thats not the problem

pure sierra
#

^

long raft
#

they have too many interactions between entities

fickle aurora
#

that is easy to overcome

long raft
#

its probably one of the most difficult problems they have

pure sierra
#

latency and timings

long raft
#

so much so that theyre developing a new network engine because theres a market failure

fickle aurora
#

foxhole has so few entities though

long raft
#

but they each have a lot of actions

#

i mean ... i wouldnt agree few entities. it has a lot

fickle aurora
#

compared to a game like eve online where one server can handle like 40,000 entities

long raft
#

how many thousands of buildings and people and vehicles are operating

#

yes but in eve online they are far apart, and they dont interact

fickle aurora
#

they already split up every map into areas

pure sierra
#

the player limit is inherrited from unreal engine, and matches other games with the same, which matches pretty much every other mp game for ever, so..

long raft
#

thats for your graphics card to handle

#

in terms of their servers, they choke when people get close together

fickle aurora
#

the servers dont handle graphics at all

long raft
#

im not saying that

fickle aurora
#

unless you mean the new server side graphics processing which nvidia is working on

#

that is a new technology not even really available yet

long raft
#

they split the levels so the users can load them

#

the server is stressed not by the graphics, but by the interactions, which are very large compared to other games

#

every vehicle and person and gunshot has to be tested for collisions

#

theres all the crazy ai mechanics, object vs object physics (so you cant walk through stuff)

fickle aurora
#

like which other games? like I said eve handles several thousand on one small area

long raft
#

no it doesnt lol

#

we've heard about eve crashing

pure sierra
#

which are all time sensitive by nature, yet you have time insensitive data transfers

fickle aurora
#

it does, I was in one of those big battles

long raft
#

but even if there were thousands in a small area - their number of interactions is lower

fickle aurora
#

even the data rate wasn't bad

long raft
#

i dunno why im defending the devs. yeah sure their servers should be better. rewrite them in C im sure theyll be perfect then

#

obviously it solves every problem

fickle aurora
#

the biggest problem for the server end is allocating and storing all the client profiles when everyone all connects at once

long raft
#

wololol yeah profiles are the big problem

fickle aurora
#

well you are familiar with data structures I assume

pure sierra
#

its not about the profiles, but just the sheer number of connections, essentially ddos situation

fickle aurora
#

every user connected would have a structure with all the data pertaining to them, like their name, their address, what items are in their inventory, etc

long raft
#

Gpu computation is the answer if they're not using it already

fickle aurora
#

yes that is why you use some kind of queue system like kqueue

#

or select

long raft
#

if theyre trying to handle the physics simulation of 160 players on a xeon, then yes, GPU computation would be the solution

fickle aurora
#

physics is all client side really, thats why people are able to speed hack and such like that

long raft
#

No it's not actually

fickle aurora
#

they can bypass the calculations

long raft
#

The servers would be much faster if it was

#

It's done on both

fickle aurora
#

you mean, a special math co-processor would be the solution?

long raft
#

seems like some game servers need a GPU, so makes me think the unreal network engine might be able to use a gpu

#

if you consider a video card to be a math coprocessor, then yes

fickle aurora
#

you know why math co-processors are better at math than general purpose registers?

long raft
#

ya this seems like maybe theyre doing this already

#

because they work in parallel and they allow less accurate math

fickle aurora
#

it's in the 5000 page intel 64 and IA-32 architecture book

long raft
#

it would have taken me days to render grom8k without using my GPU

fickle aurora
#

calculations in binary require a lot of CPU cycles to complete

long raft
#

do you mean floating point?

#

because saying a computer takes a lot of cycles to do math is ... uhhh .. ok?

fickle aurora
#

if instead you could use transistors and resistors to use current dividers to perform math, you could get division problems solved in far less time than would take to perform the same division in binary

long raft
#

you would be surprised, floating point math on the CPU is pretty fast; its about 50% as fast as integer math

#

they just dont operate in high scale, if you use the parallel instructions you can get parallelism of like 128

#

but the graphics cards are in the thousands

#

and again, less accuracy is an option on video cards

fickle aurora
#

and that is exactly why every CPU has a math coprocessing unit with analog to digital conversion

long raft
#

huh

#

they dont have coprocessors anymore, floating point math is done on the cpu directly

#

they do digital math

fickle aurora
#

now the problem is that you need to specifically access the math coprocessor registers, the compiler won't automatically use them

long raft
#

youre talking about the new set, like SIMD

#

funny, in C# i can have them automatically used by the compiler (in mono)

fickle aurora
#

they have math coprocessors inside the CPU instead of outside

#

long ago it used to be a separate chip

long raft
#

its not a "co" processor anymore

#

its just part of the CPU

fickle aurora
#

Intel still calls it the x87 Floating Point Unit

long raft
#

oh i didnt know that

#

thats fun

#

yah graphics cards have become coprocessors now, not really graphics cards

fickle aurora
#

AMD probably has the same thing, but I have not read their specification

long raft
#

i figured it was its own ALU

fickle aurora
#

the thing is, GPU is slower (clock speed) than CPU, so why not use the math coprocessor on the CPU?

long raft
#

because it can do more

fickle aurora
#

the thing is, C# will not automatically use those registers...

long raft
#

it will actually

fickle aurora
#

a lot of people make that claim but try testing it out and look in debug to see what registers it uses

long raft
#

not when you use + or - implicitly, but when you use the routines, if the processor supports simd instructions they will be compiled to use it

fickle aurora
#

none of the registers it uses are coprocessor ones, in fact, Ive only ever seen it using the regular general purpose registers

long raft
#

it would be the same thing in C, but youd need 2 binaries, one that supports SIMD and one that doesnt

fickle aurora
#

yeah but also depends on your compiler in that case as the compiler makes the determination of which CPU registers to use

#

and then you might as well go back to using assembly julianlol

long raft
fickle aurora
#

this is why hand coding small functions in assembly is worth doing

long raft
#

lol

fickle aurora
#

just custom make some functions to do the math on the proper math coprocessors and then have it return your values

long raft
#

i mean thats what i do, but with the GPU

fickle aurora
#

just in case you thought something was obsolete, Intel apparently has recycled every piece of technology and included it as they made newer products

long raft
#

yah its crazy to think as computers gradually get better each step along there is somebody brilliant making a clever variation that squeezes out just a little more

#

i've watched the same thing in compression

#

like television in the us has drastically reduced its radio band because theyre compressing the hell out of it, its fantastic quality at a sliver of the size

#

it happened over like 15-20 years only

fickle aurora
#

what I am trying to say is that the basic operation of computers hasn't really changed, the only ones saying this or that is obsolete is Microsoft or Apple because they make money on the basis of telling everyone to drop old and buy new

long raft
#

people are trying to do more complicated things faster

#

in that way its changed

#

im not a person who believes computing was perfected in 1975

fickle aurora
#

well I almost reinvented the wheel until I learned Intel was using analog signals to perform math...

#

everyone says computers are all digital

#

but then again, I might not be on a wrong start, there might just be a business model in math intensive processors that you could plug into a PCIe slot

long raft
#

uhh

#

like graphics cards?

fickle aurora
#

those are too focused on graphics still

long raft
#

no they arent

#

they just do floating point math now

fickle aurora
#

and they have DDR5

long raft
#

yeah

#

memory on graphics cards is ... different. its relatively slow.

fickle aurora
#

well, darn, the bottleneck will still be pcie

long raft
#

you cant beat the price/performance of a graphics card

#

graphics card programming is very tricky. algorithms that would be fast on a cpu are slow on a graphics card

#

they can crunch heavy heavy numbers but memory access is their achille's heel

fickle aurora
#

well for math coprocessing it has to convert to analog, measure current across resistors and then convert it back to digital - though it can still do it all in less than 1 tick

#

to do the same thing in binary would take several ticks

fickle aurora
#

I have to admit I was kind of afraid to try assembly until I played that silly shenzhen IO game several years ago

long raft
#

never heard of it

fickle aurora
#

there is also TIS-100 but that is much harder to play

fickle aurora
#

here I changed the initial test code to actually check for null character and here it is

#

#include <stdio.h>
#include <string.h>

int main (int argc, char *argv[])
{
  int i = 0;
  if (argc < 2)
  {
    printf("%s:Command not executed. Format: %s <value>\r\n", argv[0], argv[0]);
    return -1;
  }
  printf("Entered Value: %s\r\n", argv[1]);
  printf("String Memory Location: %d\r\n", &argv[1]);
  for (i=0;i<=strlen(argv[1]);i++)
  {
    if (i < (strlen(argv[1])))
      printf("Character Memory Location (%c): %d\r\n", argv[1][i], &argv[1][i]);
    if (argv[1][i] == '\0')
      printf("Character Memory Location (null): %d\r\n", &argv[1][i]);
  }
  return 0;
}```
#

in this new test code, it only prints that null line if the detected character in the array matches '\0'

#

here is another test showing that you can point to each subsequent address and it will display the string all the way from the address you started from all the way up to the null terminator

#

#include <stdio.h>
#include <string.h>

int main (int argc, char *argv[])
{
  int i = 0;
  if (argc < 2)
  {
    printf("%s:Command not executed. Format: %s <value>\r\n", argv[0], argv[0]);
    return -1;
  }
  printf("Entered Value: %s\r\n", argv[1]);
  printf("String Memory Location: %d\r\n", &argv[1]);
  for (i=0;i<=strlen(argv[1]);i++)
  {
    if (i < (strlen(argv[1])))
      printf("Character Memory Location (%c): %d\r\n", argv[1][i], &argv[1][i]);
    if (argv[1][i] == '\0')
      printf("Character Memory Location (null): %d\r\n", &argv[1][i]);
  }
  printf("Pulling string from each memory address, which will show the string\r\n");
  printf("from the selected memory address all the way to the null terminating character:\r\n");
  for (i=0;i<=strlen(argv[1]);i++)
  {
    char *p = &argv[1][i];

    printf("Address %d: %s\r\n", &argv[1][i], p);
  }
  return 0;
}```
#

and yes of course this testing is being done on Windows 10 Pro with the latest updates, using gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0

#

since the value of p is technically just a pointer, it is harder to grab one single character, I would have to make a function to copy the whole string from memory to a regular character array and then pick each character from the array to display

#

but here's the thing right - in C# is it really easy like this to literally just pick whatever you want from a specific memory address? :D

long raft
#

yes

#

ignoring virtual memory

fickle aurora
#

with this code you can see when you point to an already stored string, like for example if you say char *value="hello"; char *pointer; and then pointer = value; , the code in Test3.c will prove that the value of pointer will equal the address number of value[0]

long raft
meager rampart
#

Guys I just want you to know I'm supportive of this back and forth about c and this sort of passive epeenery thing you have going on. This is quickly becoming my favorite channel to catch up on. :D

severe jewel
#

this is true

#

most entertaining stuff that's long running

astral sinew
#

this is like... serious longshot, anyone know if theres a fundamental difference in how games like foxhole or league of legends runs on your pc compared to rimworld and stellaris? Because the latter 2 games freeze my pc within 15-45 minutes of being turned on but the former have literally never frozen my PC in hundreds of hours of gameplay

barren quarry
#

rimworld and stellaris simply have more objects

#

more stuff going on at the same time

#

it has to calculate the pathing for dozens of animals and your colonists

#

same goes for stellaris ai and ships

astral sinew
#

i can imagine but

barren quarry
#

it has to do with processing power i guess

astral sinew
#

i just had it crash on me with this (physical photo since it froze obv)

#

and i was like minmaxing all my performances, games liek stellaris take up minimum 40 cpu, 40 ram, foxhole has probably same ram, cpu but like double the graphics

#

it was a 1 man colony at this point anyway even if there are animals

#

its def hardware issue im just at a loss for what it could be when theres 100 % consistency in what games do and dont freeze the entire pc

fickle aurora
#

the main problem is hardware related, people just don't have enough real memory (RAM) and the rest is page file space - even with SSD page file space, it's not very great because SATA 3 has a top speed of around 500mbps and PCIe has a top speed of around 1Gbps, where even the oldest DDR type memory could surpass both of those metrics

#

for example, I use DDR3, why, well, it's 10Gbps and I don't feel like I need faster RAM, but you know, I can put all of star citizen on a ramdisk and run it with some RAM to spare, because, well it's a workstation not a regular PC

#

I can do some pretty crazy things with my computer in fact, in BIOS there are options like memory sparing which will reserve some memory as a backup in case the main memory fails, or I can mirror it which will make it even faster because the memory is split in half and can run in parallel, sort of like RAID disks, all because, well, it's a workstation PC

#

foxhole of course uses like 2-4GB of memory, I can't recall exactly how much it used but it was well below what I would expect from modern games - other games like star citizen, it will take about 20-30GB while it is running - if you don't have space it will use page file space and run at very low frame rates

#

there may have been a purpose to this in order to allow people with lower hardware spec to play foxhole, I can definitely see this as an intended design practise

#

steam has some games that are terrible graphics, they run slow and hog all your memory - those other games are often designed with no care put into memory management - it is probably more efficient to allocate as much memory as you think your program will use - and then develop functions that handle your entire allocated memory block (of course only possible in C/C++), but most people allocate/reallocate as they progress - and if those unused memory locations are not free()'d, then your program will keep growing in memory usage over time until all the memory for the system is being used by that one program

#

in C# I believe the new keyword is of course for allocating and delete is performs the function of free(), so if you are not explicitly deleting your unused variables after you are finished using them, assuming you created them with the new keyword, then you are just hogging memory that could be used by another program or even reallocated somewhere else

#

scratch that, Microsoft has removed the delete keyword from C#, so looks like you have no choice but to have terribly inefficient code in that language - supposedly there is a garbage collection system, but regardless, I can't really test how efficient it is since Microsoft wants me to pay them for a license just to test C# - why would I buy it when I can spend money on a 32 bit C compiler for a microcontroller and make better stuff - without EULAs

long raft
#

C removed the delete keyword, richard stalman wants you to pay in feet pics to use his compiler

fickle aurora
#

lol

#

I am working on a new test you will like, if you are interested, I am trying to help people and also prove what I am claiming using code

long raft
#

i am not

#

your code is like 1st year students to me

languid harness
#

oof

fickle aurora
#

yes the whole idea is I want to show how you can allocate more and more memory, and over the course of that, if those blocks are not free()'d, they will still be hogged by the program and you can see it in task manager performance of course

long raft
#

seriously, that richard stalman is into feet and he propositions women and hes got business cards about it. and then he got metoo'd

#

you dont need to show me how memory works, i already know how it works

fickle aurora
#

for me, I have 64GB mem so I wont be running out, and I just found some cheap used ECC modules the same part numbers that I was looking for, so I ordered more... just for the heck of it :D

long raft
#

ram is really cheap right now

fickle aurora
#

I have to buy only registered ECC for this computer, regular mem cannot work

long raft
#

cool

fickle aurora
#

but the motherboard supports up to 512GB and the CPUs support 768GB or so

#

takes forever to boot because it checks the entire memory for errors on boot

long raft
#

64 gig chips are about $1000 a piece

#

but you can get 384GB of ram in smaller chips for about $800 of ECC

#

that stuff is cheeeeap

fickle aurora
#

for me it's like 50 bucks for a 32GB module on sale

long raft
#

you can buy lots of ram on ebay from old dell servers

fickle aurora
#

yeah I need to buy identical part numbers in order to use memory mirroring

#

mirroring effectively doubles the throughput

fickle aurora
#

for those who were interested in checking out my new memory allocation test, Test4.c here it is https://pastebin.com/NPQXXv7x it can be compiled with the free GNU C++ compiler for windows called MinGW-W64 which is a Windows 10 64-bit implementation of the GNU C++ compiler and libraries