#code-talk

2 messages · Page 12 of 1

long raft
#

and moderation...

#

otherwise george michael just posts everywhere he isn't waiting to ambush

pure sierra
#

yeah and then team restrictions, basically fh global

kind glacier
#

like a game show?

such as ?
Such as a war room

pure sierra
#

like foxhole global ?

kind glacier
#

?

pure sierra
#

its been done

kind glacier
#

Yeah, I found it.

#

Actually looks familiar

pure sierra
#

theres a few sites that share the global map structure, such as sethfires

kind glacier
#

but not quite what I meant, I suppose

long raft
#

yah maybe foxhole global can just absorb logiwaze

#

we can put everything on kas's back

kind glacier
#

Technically like Foxhole Global but more like Radio Commander and Radio General

long raft
#

well feel free, its all open source

#

the code is messy, but the build process... works

kind glacier
#

I've been considering it, but I'm a programmer not a 3d modeler

long raft
#

god projects like these i really remember im not a javascript programmer and that i hate it

kind glacier
#

and I'd need to work on that rather fulltime if I want to actually make something useful out of it

#

at best that stuff would be in Unity

long raft
#

mmm unity, where i can use c# 👍

kind glacier
#

But the idea of a 3d war room client (instead of a website) did throw me for a loop

pure sierra
#

so in game ?

#

just make game overlay like the arty calc

long raft
#

uhh why not make it a website? unity fits in websites

kind glacier
#

can a website do 3d tho

long raft
#

yah

#

unity has a plugin

#

or you can compile to javascript

#

no plugin needed...

kind glacier
long raft
#

it does webgl as an output format

#

yeah

kind glacier
#

Cuz while foxhole global is nice

#

the map loads in on the fly

#

it feels... slow

#

which funnily enough is the same problem that the Heroes and Generals client suffers from

long raft
#

what feels slow?

kind glacier
#

much like google maps it loads in slower than I can move around

#

and doesn't draw until I stop zooming in or out

pure sierra
#

welcome to the web

long raft
#

ah

pure sierra
#

if i built my site from start again, its try and do it all in html5 canvas

long raft
#

boy i think id do mine in blazor

pure sierra
#

(the map part atleast )

long raft
#

im so sick of working in javascript at all

kind glacier
#

It would be cool to get the whole thing to give that world war vibe as that trailer above

pure sierra
#

that game does look pretty cool,

#

neat concept

barren quarry
#

once in a while this channel is neither dead nor microelectronics

long raft
#

i mean, all of this stuff should be in foxhole proper

#

like some sort of communication and direction room, a war room

pure sierra
#

the game itself needs an addon/mod abilty, but ther be dragons

kind glacier
#

General might be somewhat ahead of Commander

pure sierra
#

i really want to try this game now

#

something very special and different to play a game with voice

kind glacier
#

But this is my wishful thinking, the ability to have your leadership in a 3d war room where people can move around little figures on a map that updates according to your faction's intel and where you might even be able to send out orders to the people playing Foxhole for real.

pure sierra
#

a 2 way api would be cool

kind glacier
#

well, a discord voice room would be the next best thing, but that stuff can get messy

#

especially when you want to have only one guy run messages between the leadership and the soldiers

pure sierra
#

yep

kind glacier
#

he'd have to constantly switch channels

#

lol

pure sierra
#

some kind of in built game commander room would be good that gave people in there spacial actions and ability

#

like a structure built

#

so it becomes a strategic target for enemy

#

while giving benefit to team

#

like a bunker addon

#

the best thing to do would be make up a proposal and share it around, and then wait about a year for the devs to add it, like mines

kind glacier
#

Yeah. Though it would be preferable if anyone entering the structure is removed from the list of players as having 6 people in there discussing strategy is 6 less rifles on the front or 6 less trucks in the backlines

pure sierra
#

yeah there would be some kind of limit to it, but also way of sharing it around

#

with people of enough rank

kind glacier
#

That said, it would be an operation thing as giving out orders to randos who play alone is never going to be well-received

long raft
#

i would opt in, and im a random

pure sierra
#

actually that would be very cool if you could give waypoints and requests/commands to players that they see, they can ignore it or not, but would give good option for players looking for guidance and something to do

kind glacier
#

oh yeah

pure sierra
#

and help coord everyone

long raft
#

randoms arent asexual, theyre just not looking for a relationship, know what i mean?

kind glacier
#

recently more than you'd care to imagine

#

anyway

#

So you might have a general order for randoms who opt-in and another set of orders for operations and/or squads

#

Man, this is getting me excited again

pure sierra
#

ok so how do we control/decide who gets to be commander/s ?

kind glacier
#

good question

#

though it wouldn't be a solo thing

#

imo

pure sierra
#

u mean not available to soloers or not done by just one person

#

(not sure if u ever played bf4? commander mode, it was similar)

kind glacier
#

the latter

pure sierra
#

sure thats why i said commander/s
then we need to work out who gets to do it , if assuming there is a limit on it

#

and what happens if people dont like who`s doing it

kind glacier
#

All good points

#

Can't quite find an example of what I'd imagine would be ideal

long raft
#

simple invite system

pure sierra
#

what could work, would be that apon recieving an order, you could acknowledge it or disregard it (key press) and this forms the basis of voting system, if too many people disregard ur orders u either get booted from role, or there is option to be replaced by someone else

#

invite by who ?

kind glacier
pure sierra
#

crazy to think they really did that

kind glacier
#

I'd imagine that depending on the number of people who opt in you can divide who gets command over what

pure sierra
#

no it cant be opt in

kind glacier
#

opt out?

#

I find it hard to imagine that someone who just wants to play an hour or two of foxhole after getting home is eager to get hit over the head with movement orders

pure sierra
#

maybe opt out, or just ignore/vote disregard order

#

its would be sublte though, just like a message in the corner not in middle of screen

#

and show waypoint on map

#

, u can ignore it, or reply to work towards it or disregard it

kind glacier
#

like the technology notification?

pure sierra
#

pretty much

#

*u got mail

kind glacier
#

oh what

#

I have the foxhole global open and I just heard presscorps

#

fuckin neato

#

but tbh the technology notification is something I miss most of the time

#

getting shot at and all

pure sierra
#

but you make it like not fade away

kind glacier
#

Like the squad invitation?

pure sierra
#

its just up there "current orders"

kind glacier
#

yeah that could work

pure sierra
#

like a chat tab

#

and each on also shows in map screen with waypoint if assigned

kind glacier
#

Hell, you could make radios more interesting this way too

#

standing orders get updated alongside map intel

#

and the radio backpack could allow you to reply, either with voip or from a list of responses

pure sierra
#

nah too much

kind glacier
#

¯_(ツ)_/¯

pure sierra
#

i think you could have voice chat with commander though regardless

#

by request

#

so like u making a call

kind glacier
#

skype tune

pure sierra
#

so he dont have everyoene yelling at him

#

and vice versa

kind glacier
pure sierra
#

so basically commanders orders build up their 'karma' points and lets them stay there or be replaced, also people going to given waypoints could earn points , but we cant call them points as devs cry

kind glacier
#

You make it sound like it's a timer that gets replenished by people giving you the thumbs up

pure sierra
#

pretty much

kind glacier
#

ehh

pure sierra
#

upvote/downvote

kind glacier
#

that's more like it I suppose

#

As doing nothing with shit going down should earn you downvotes, but doing nothing when there's actually nothing to do shouldn't get you kicked out.

pure sierra
#

a good commander benefit would be seeing player names next to icon in map and icon types for friendly vehicles,

kind glacier
#

If every soldier and vehicle is a little figure on the map it would get really crowded really fast

pure sierra
#

maybe you just get that data on hover

kind glacier
#

I suppose that as you zoom in and out they blend into figures of multiple soldiers or break apart into figures of single soldiers.

#

Other question though

#

would it be global (what I'd like) or regional?

#

Or both, which tbh I don't see happening as that would be dozens of players just playing commander instead of soldier

#

Would be cool for Foxhole 2 tho

pure sierra
#

not sure, could be both, i only imagine there being max 2-3 slots per team per map

kind glacier
#

2-3 commander slots?

pure sierra
#

yes

kind glacier
#

globally, that's not a lot of leadership for 70 people per region

pure sierra
#

2-3 per region

kind glacier
#

Though that would probably be narrowed down to 20 people who actually care enough to follow the orders

#

not counting big clans

#

2-3 per region
The dream would be to have people on the global scale give general orders that people on the regional scale try to put into action by giving more specific orders.

#

But if there's one thing I wish could be coordinated on the global scale it's logistics. I don't like how you have to look at the FOB/BB inventory on the map and then guess what it is they need the most.

#

(Or ask, but you'd probably get only 2 answers that contradict each other anyway)

pure sierra
#

would be good if players could vote on items 'in stockpile they want, and then that gets summurized at logi station rather than having to look at each fob in map

kind glacier
#

And then you might have someone like me who just really wants sniper rifles

#

yes, that would be good

pure sierra
#

or what about a currency system ! where u could actually order stuff and have it delivered

kind glacier
#

I don't understand why there isn't such a vote system, particularly with how you can now vote on base upgrades only if you have your spawn set there.

pure sierra
#

that base vote system blows

#

it should default your vote there

#

(where ur spawn is)

kind glacier
#

or what about a currency system ! where u could actually order stuff and have it delivered
Invest commends into a communal pot for specific weapons and ammo

#

And whoever completes the order gets the commends

pure sierra
#

yeah cool

kind glacier
#

1:1 might end up creating a lot of Field Marshals over a short amount of time though

#

and a partial completion would net you a partial amount of the commend pot

pure sierra
#

as well as or instead of commends it could be resources, that way it gives front liners an incentive to collect them for logi return trip

kind glacier
#

Possibly

#

The war room idea gets me all giddy, but by now we're talking about a full on feature inside the game, which knowing the devs would be 3 years away if they even decide that it fits the game.

pure sierra
#

i know, this is the sad thing, it seems like we have active devs and they engage us, but really changes still take too long, as theres always bugs, nerfs and new vehicles for them to focus on

#

thats why it would be cool if they opened the game up to a 2 way api for approved community devs

kind glacier
#

I might put in some weekend hours if that were the case

pure sierra
#

but even that would be a big project for them, and i dont think they would like the work of maintaining it, they struggle enough with the current api

#

(which could do with some improvements)

kind glacier
#

any chance of getting something like that off the ground would be a seperate client with the one way api

#

and I'mma be honest, as much as I love dreaming about it, I still haven't got a clue how to design or build it

pure sierra
#

we all learning

kind glacier
#

first 3 weeks would be just figuring out how to wrangle the api

#

and then how to get it to do more than just draw on a 2d window

#

even if I worked on it 9 to 5, it would still be several months

#

¯_(ツ)_/¯

#

and fuckall documentation too HBjoy

pure sierra
#

i what are we doing making their game for them....

#

unpaid

kind glacier
#

Plenty of people do that already

#

either as full on playable stuff or just 10 page google docs of game design

long raft
#

it feels like submitting funny jokes to be used in the family circus newspaper comic - theyre never gonna use it

kind glacier
#

That's pretty much with every suggestion board where you don't get to talk directly to a dev in charge

pure sierra
#

so they basically deleted the suggestions channel ?

kind glacier
#

it's the game feedback channel now

#

But even the most upvoted suggestions just get passed over

pure sierra
#

ah there it is

#

still a trash can though for them

long raft
#

you know as developers we believe in this myth that theres some way they could have made foxhole where mark was just coasting and not stressing

#

and theyd have time for outside input julianlol

pure sierra
#

im sure its constant damage control and putting out fires most of the time there

kind glacier
#

I mean, I don't pretend to think they have the time to sit around

#

But there definitely are design choices I don't agree with

#

which are also the least likely to change based on outside suggestions

pure sierra
#

yep

#

i think they should bring back the war games experimental modes

pure sierra
fickle aurora
#

even a one way output data API would be great

#

using interrupts/events/hooks or something

pure sierra
#

from the game ?

fickle aurora
#

yeah but I am probably thinking client side, where you were thinking server side

#

the thing is client side API could open up potential to do more than just export map data, but also could do things like allow you to capture where your character is on map and maybe you could use 3rd party software to transmit that information automatically to your clan's discord channel or something

#

so if for example a whole clan is doing operations, they could see where all their members are located on map from API or something

pure sierra
#

yeah cool

fickle aurora
#

in terms of security/privacy, a client side function would allow a person to opt out for sure

#

sending out chat text through API would also be wonderful perhaps

#

client side would mean you would have to be logged in and actively playing the game for the data to be retrieved in this case

#

voice chat can theoretically already be manipulated without API since it goes through hardware drivers

#

wouldn't take much probably to write a driver that copies the speaker output back to line in/mic and play that back to a discord voice channel, though you probably can already do it in something like soundflower anyway

pure sierra
#

its a novel idea, you can also use memory tools to read a games state, so u dont even necessarily need an official api

barren quarry
#

@pure sierra yeah thats a straight road into vac banana

pure sierra
#

not sure it is outlawed specifically

barren quarry
pure sierra
#

thats right, i forgot about that

#

maybe it could be dev approved

fickle aurora
#

I mean there are ways around VAC but probably not good to talk about it

#

if you ran windows in a virtual environment, perhaps you could still read the memory from the main OS but the virtualized environment probably wouldn't know

#

that would definitely be a far stretch

pure sierra
#

@barren quarry so do that include the overlay arty calc ?

barren quarry
#

apparently

fickle aurora
#

I thought that thing was calculated on pixels or something, haven't tried it though

pure sierra
#

@barren quarry i woeuld think technically yes too

fickle aurora
#

like if you know the current screen resolution and you have a screenshot of the map the program could make an accurate calculation on that probably

#

I think what Max is referring to mostly is better safe than sorry because we don't know exactly how VAC triggers

#

a little common sense probably goes a long way too

long raft
#

i would love if a user could query their location. obviously.

#

that would be as epic as could possibly be

barren quarry
#

Everyone would

long raft
#

it seems so achieveable, i want it so bad now

#

so you generate a private key, you encrypt the steam id by that private key and you display it as the user's API key

#

wouldnt be a crazy security issue that way

neat fossil
#

i cant imagine its a ton of work to export the height map
doesn't have to be done all that often
A height map =/= a topographical map. It's not as easy as you imagine it is to generate (else we'd be doing it for our own maps). A height map is just black & white data used to generate terrain (and the way it's stored in engine isn't all that usable). The maps themselves are not scaled realistically either (most of our topology is tiers of flat terrain)

long raft
#

its not easy to generate a height map? yes i find that surprising

#

it seems like thats what one would ideally make a topography map from tho

languid harness
#

Get the height map, join them together, load them into a GIS (or city skylines for that matter), display heightlines, export/screenshot, overlay gamemap with file, add rocks and the like
Now to automate that, that is the real challenge and I bet the devs have more important stuff to work on. Also, knowing (and paraphrashing Matt) how the terrain is basically a set of plateaus makes it very hard to make any automated sensible looking topographic map.

neat fossil
#

This is what the heightmaps actually look like (this is Deadlands). It's not exactly conducive to usable topography. You can maybe see where some basic elevation is in the map, but you can glean that much information from the maps as-is.

Because the scale isn't realistic, it's just not as useful as it would be if say I generated a heightmap from a real location and then turned that into a topographic map or imported that into the engine.

#

Is it possible to make it work? Yeah. Anything is possible. Is it easy to automate into a process that works in our pipeline without a lot of manual intervention? Absolutely not.

barren quarry
#

i think that even in that form the images could be quite useful when considering gradients

neat fossil
#

yeah, it is, but it's not detailed enough to really disseminate any information at the infantry level, where that kind of thing would matter more. This level of gradation is already used to generate the in-game maps.

kind glacier
#

Hm, now I'm reminded of a panel on terrain generation

neat fossil
#

If you're making like, say a first person game. You'd use some tool, like Houdini or World machine to generate terrain to use for Vistas/a base for playable terrain.

kind glacier
#

🤔

long raft
#

matt, i must say, thats all i want. are those images just like you posted.

#

i could make a topography map from that i think

#

and i dont need all the colors and stuff, that deadlands heightmap is exactly what i would wish for

#

my knowledge of maps, tho, is much weaker than my knowledge of 3d terrain

#

can i see the rest of those, tho? just looking at deadlands is blowing my mind. i had no idea that NE area was highlands

#

its like a big valley of a map. never realized this before

#

my mind is on fire after seeing this!

coral sundial
#

you never realized? its quite easy to get a sense of deadlands weird and wild variety

neat fossil
#

I'm actually not going to supply these because unfortunately it's not really my call, nor is it feasible every update.
Maybe after 1.0 we can come up with a system that generates heightmaps along with the map images, and posts them to some community folder.

#

I'll inquire about it

#

but right now it'd all have to be manual.

pure sierra
#

nice to get your reply @neat fossil , what area are you mainly working on there at the moment ?

neat fossil
#

I work on a ton of stuff. 😂

pure sierra
#

the first thing that comes to mind which im sure ur aware of is the vaulting is pretty hit and miss at the moment, quite frustrating

long raft
#

ok 😦

kind glacier
#

@pure sierra Imma be honest with you, I snoozed through the presentations on REST and APIs so I'm gonna need some help understanding this war api

pure sierra
#

you just load the url, and get the data

vague otter
#

basically
Send AJAX request

#

read JSON

#

if youre doing JS

kind glacier
#

I'm not

pure sierra
#

what lang ?

kind glacier
#

C#

pure sierra
#

@long raft

#

with php i do curl requests

#

likely similar in c#

#

essentially server side command to make a GET request on url

#

GET is what browser does when u load a page

kind glacier
#

My PC is fucked atm so I'm trying to figure this API out while I wait for a new power supply that should fix the problem

long raft
#

i've only built like 1 or 2 APIs in .net, ya know with asp.net core

#

i found it to be very easy, but dependency injection is confusing

#

oh but reading the war API is pretty easy

pure sierra
#

thats all he wants

long raft
#

hmm

#

let me check what i have

kind glacier
#

oh but reading the war API is pretty easy
making fun of me :(

long raft
#

lol i have one example of reading the war API and also hosting a map request API lol

kind glacier
#

I flat out suck with httpclient

long raft
#

but its like 400 ugly lines jammed together in 1 function

#
private Dictionary<string, (string ETag, string data)> JSONCache = new Dictionary<string, (string ETag, string data)>();

private async Task<string> GetJSONStream(string URL)
        {
            (string ETag, string data) CacheElement;
            bool Cached;
            lock (JSONCache)
                Cached = JSONCache.TryGetValue(URL, out CacheElement);
            var request = new HttpRequestMessage() { RequestUri = new Uri(URL), Method = HttpMethod.Get };
            if (Cached)
                request.Headers.Add("If-None-Match", CacheElement.ETag);
            System.Net.Http.HttpClient webclient = new System.Net.Http.HttpClient();
            var response = await webclient.SendAsync(request);
            if (response.StatusCode == System.Net.HttpStatusCode.NotModified)
                return CacheElement.data;
            var stream = new System.IO.StreamReader(await response.Content.ReadAsStreamAsync(), System.Text.Encoding.UTF8).ReadToEnd();
            if (response.Headers.Contains("ETag"))
            {
                string ETag = response.Headers.GetValues("ETag").First();
                lock (JSONCache)
                    if (JSONCache.ContainsKey(URL))
                        JSONCache[URL] = (ETag, stream);
                    else
                        JSONCache.Add(URL, (ETag, stream));
            }
            return stream;
        }
kind glacier
#

ah fuck

#

some of those I recognize as words

#

:(

pure sierra
#

ditch c#

long raft
#

And as an example I called it like so:

var api_result = JObject.Parse(GetJSONStream("https://war-service-live.foxholeservices.com/api/worldconquest/maps/" + map.ToString() + "/dynamic/public").Result);
#

not very good async/await there. oof.

#

anyway thats like ... exactly what you need. query the API, check the etags and use the cache when theyre not out of date

#

returns a string you can parse into json

barren quarry
#

my code for updating a single region is 106 lines long

#

normal people use axios

#

but axios cant fucking cancel requests on state change

#

so you have to do it with XHR

long raft
#

i really hate looking back at useful but ugly old code i wrote

vague otter
#

If youre using VS might be easier to use an HTTP client from a package for requesting stuff

#

Should be easy to find

long raft
#

it's included, System.Net.Http.HttpClient

#

im not sure if you have to actually ... nuget that or what

#

i seemed to think it was part of the framework, either way its microsoft's code

#

their old system.net.webclient was downright awful for https queries

vague otter
#

still feel its a bit bothersome with the default one

long raft
#

its a good library but its heavy handed with the async stuff

vague otter
#

look at these pretty builder interfaces

long raft
#

i think thats actually longer than my code using httpclient

vague otter
#

Is it though?
I see a lot less code in those examples xd

#

Though the main benefit is probably how testable it is

#

I don't think the system http client is very test-friendly

long raft
#

well my code block does more, but the actual httpclient code is like 4 lines

vague otter
#

Ive got nothing against your code
Just saying it might be easier to use a simpler interface

long raft
#

is it still going to be simple if you have to check and cache the etags?

vague otter
#

Im not familiar with it, but the cache ofc. youd still have to do yourself
getting a header value should be a oneliner tho (also doesnt .net now have thread safe implementations for dictionary? i thought so)

long raft
#

yea it does

vague otter
#

Ah

long raft
#

not sure how i feel about the concurrent ones tho

vague otter
#

Probably not when you wrote that

long raft
#

sometimes theyre useful, sometimes not

#

oh no i wrote that like 18 months ago

#

concurrent dictionary has been around for like 15 years lol

vague otter
#

I dont have to do concurrent stuff with shared resources often
Just keep everything stateless julianlol

long raft
#

i was proud to see i even bothered to make it threadsafe

#

just lock everything, right? julianlol

vague otter
#

lock {

#

<put your program here>

#

}

#

Cant be unsafe if theres only one thread

long raft
#

lol

#

lock is so crazy in c#

vague otter
#

Whats crazy about it?

long raft
#

its confusing unless you read about what it is and how it works, its just not intuitive

#

like, its just Monitor.Enter() and Exit() being called

#

but thats also where youre supposed to mutex releases and waits and stuff, is inside that

#

intuitively it seems like doing that would cause a deadlock

#

like in the C world, definitely.

vague otter
#

Hm
Using Monitor.Enter() by itself is not advised cause it's easy to DL
Thats about all I know about it :>

#

why lock statement exists

long raft
#

also it cant do everything the monitor object can, but its like it's own try/finally block where youll never forget to monitor.exit

vague otter
#

^

long raft
#

but causes ugliness in certain logic

kind glacier
#

aw yis, managed to get map names

#

no clue how

#

:)

barren quarry
#

/maps

kind glacier
#

well yeah

#

but I haven't worked with apis before

#

¯_(ツ)_/¯

#

baby steps

long raft
#

yep

#

someone should make an API standard ...

#

maybe something based on XML ... with a big intricate request and response format ...

#

but we'll call it "simple"...

#

maybe im the only boomer here whos used SOAP

#

everything microsoft does it really well planned and totally over engineered

fickle aurora
#

this is exactly why I always say C is the best language because it is basically able to achieve what assembler can achieve, it is great for manipulating strings, and easy to understand

#

but I don't do anything graphical, that is another department

#

if there is something you cannot do in C# you can always write it in C and make the functions external and compile it into a DLL or object file to use

long raft
#

i cant imagine what you cant do in c# that you can do easily in C lol

#

although i think c# 9 will kind of fill all the remaining things c# cant do that c can

fickle aurora
#

well C# was made for windows, literally, window screens

long raft
#

unmanaged function pointed support coming...

#

i mean i beg to differ. c# is open source cross platform

#

there is absolutely nothing in c# specific to windows

fickle aurora
#

mono was just a way to bring C# outside windows

long raft
#

yea but dotnet core is not mono

fickle aurora
#

C# was always a microsoft thing though

barren quarry
#

i used to code in c#

long raft
#

c# is open source

fickle aurora
#

yes me too back in like 2004

barren quarry
#

i tried to learn .net core to get a job but i failed because its so boring

#

so i switched to js

long raft
#

js is pure hell

fickle aurora
#

I could never get into windowed stuff I prefer backline server side or embedded stuff

barren quarry
#

Js by itself is the worst language ever

long raft
#

actually, js is an OK language, i hate DOM and js projects

barren quarry
#

JS with typescript and react is a cocaine whore on ferrari

fickle aurora
#

the thing is server side never gets fame because nobody sees it

long raft
#

wildallan, i dunno why youre so windows focused, dotnet is not a windows thing

fickle aurora
#

it started originally by microsoft

long raft
#

ok but microsoft is not windows

#

half the technologies you use were started by microsoft

#

theyre kind of the huge player in the industry

fickle aurora
#

and C# does not compile source the same way other languages do, it relies on a runtime to operate

long raft
#

you know C was like that too, maybe you like C but then it all depends on who makes your C compiler

#

all languages require a runtime

fickle aurora
#

C does not it executes directly

long raft
#

what are you talking about

#

c absolutely has a standard library

#

glibc

#

you cant just run C code without the runtimes either, you can statically link stuff but its still got a runtime. you can do the same with c#

fickle aurora
#

yes but the difference between C and C# is C is a real language that creates machine code and C# just creates instructions for a runtime, sort of like a script

long raft
#

no ...

#

first of all, C doesnt compile to machine code.

fickle aurora
#

that is why you cannot manipulate memory in C# basically

long raft
#

and c# compiles to IL, which is compiled on first run into the same "machine code" as C

#

yes you can

#

you have all these incorrect ideas about c#

#

at best you could say a C compiler compiles code into a machine-code-like language thats OS dependent

#

still depends on a library. they both can manipulate memory in the exact same ways

fickle aurora
#

C literally makes machine code, I dont know how else to explain it

long raft
#

but it doesnt

fickle aurora
#

it is not OS dependent but it is architecture dependent

long raft
#

you cant explain it because youre taking somebody's over simplification of it

#

it is absolutely OS dependent

#

this is why a linux binary is different than a mac binary or osx binary or windows binary

#

the os will translate the executable so it can be executed as machine code

#

c# is not an interpreted language, its eventually compiled before running

fickle aurora
#

it is not considered to be a compiled language if you google it

long raft
#

it absolutely is

#

ive been doing c# for 20 18 years

fickle aurora
#

the reason is that a real compiled language produces machine code that will run on the same hardware regardless of the operating system

long raft
#

i keep telling you, c# is compiled into the same type of code as C

#

neither of them is raw machine code

#

c# has an intermediate layer, "bytecode"

fickle aurora
#

so you're saying in C# you can allocate memory?

long raft
#

of course you can

#

what language cant you?

fickle aurora
#

most of them basically don't support it because it is low level programming

long raft
#

allocating memory is like ... very basic

#

you couldnt have a modern language that cant allocate heap memory

#

nothing like that exists anymore

barren quarry
#

18 years? jesus christ how old are you

long raft
#

old.

#

i started young, i was in high school when c# came out

#

id already been programming for like 5 years

#

i was like a c++ whiz back then

barren quarry
#

so you're like 34

long raft
#

36

fickle aurora
long raft
#

in "purest" form. yea well c# doesnt need a runtime in it's "purest" form either

#

meaning you cant do anything

fickle aurora
#

C# is pretty far from pure

long raft
#

its true the c runtime is thin, because the OS is implementing most of it

#

man what are you even talking about

#

you dont seem to know a lot about C or c#

fickle aurora
#

you're right I mostly work with electronics, but C and assembly are what I use

long raft
#

you know, system calls in assembly are basically a runtime also

fickle aurora
#

that's interesting because I never had runtime execute on any of my programs

long raft
#

so youve never used printf?

fickle aurora
#

printf does not cause dllhost to start running

#

it is literally a CPU call not really something you need a runtime for

long raft
#

uhh dllhost is like a program just for running commands

#

you can still use the runtime without starting dllhost

#

printf is not a CPU call

#

thats c runtime

fickle aurora
#

certain functions in C, or rather most functions in C are CPU calls that is the big difference really

long raft
#

no not really

#

its still just a function call to a library

fickle aurora
#

yes but those basic functions in the standard library are almost all CPU calls, not really something that is extra

#

it depends on what library you are referring to, in this case the standard library is almost all CPU calls - why, well, that is the basics of how computers started and you need some baseline functionality to be able to make an operating system

long raft
#

i mean, string outputs to console is an interrupt, but printf is a complicated function call that does a lot more

fickle aurora
#

string does not actually exist, that is why any language that uses strings is not a real language in my books

long raft
#

LOL

fickle aurora
#

like you said, everything links back to libraries - string is literally a function of a character array

#

characters (char keyword) are of course a CPU function

long raft
#

bruh dont get stuck in 1960

fickle aurora
#

string is not a CPU function

#

I hate to break it to ya but none of the 70's became outdated - every computer in existence now and into the future all use the same basic CPU calls

long raft
#

nobody uses zero terminated strings anymore

#

so much from the 60s is dead and gone

fickle aurora
#

any time you use the string keyword the compiler is putting the zero character termination on the end of the char array internally

long raft
#

no its not

#

most string implementations have an integer with the string length they maintain

#

shit, even stuff from the 70s did that

fickle aurora
#

it's the way computers all function

#

I'm guessing you don't use GNU debugger?

long raft
#

I've used debuggers, I know assembly

#

ive written languages

fickle aurora
#

you would see the zero termination character on every string if you used the debugger on any binary

long raft
#

no thats not true

fickle aurora
#

you can also see the CPU calls as the debugger puts everything in assembly

#

computers all basically work the same, whether apple, acorn, microsoft, HP, etc they all have the same way of terminating character arrays with the null character

#

I doubt that C will ever die, because it's the building block of every modern system

long raft
#

agreed

fickle aurora
#

when you program with CPU calls in C or asm instead of using a modern language like C#, you will understand what I am saying

long raft
#

i just said ive done those things

#

ive written compilers

fickle aurora
#

the difference is huge in terms of efficiency, a C# program will have to revert to a library and then a runtime which converts all that information into a way the CPU can work with it

long raft
#

smh

fickle aurora
#

a C program on the other hand, when it is compiled, all those basic functions are directly linked to CPU calls so there is no need for a runtime

long raft
#

i mean, i hope you dont try to tell someone that at a job interview who knows

fickle aurora
#

if I wrote my apps in C# I would never be able to program my
20 cent microcontrollers because they have only like 64 bytes of memory to work with

long raft
#

yea but not because the reason you think

fickle aurora
#

yes, mine don't need runtimes - I wonder why

long raft
#

oh boy.

fickle aurora
#

I know it is because they are made in C or asm so no runtime needed...

#

it is not possible to write them in other languages like python or PHP or perl because those are all high level languages that rely on runtimes

long raft
#

those are interpreted languages, totally different than C or c#

fickle aurora
#

C and C# can't be put on the same level because they arent on the same level

long raft
#

you might want to update your encarta '95 and get some fresh understanding on these languages

#

these are old myths i remember

fickle aurora
#

it is not a myth

long raft
#

ive had enough C/asm master race for an entire lifetime

#

from people who are usually pretty new to both

#

seem to think theyll inherently write faster code

fickle aurora
#

C# is high level language C is low level language

long raft
#

see, thats cute to me. C is considered a high level language, i feel like we've talked about this here

fickle aurora
#

you know why C is not considered high level?

long raft
#

thats a trick question

fickle aurora
#

high level languages use runtimes

long raft
#

because it is a high level language

fickle aurora
#

what you are referring to is likely C++ not C

long raft
#

🌍 👨‍🚀 🔫 👨‍🚀 always was HLL

#

assembly is considered low level. and its still not machine code

barren quarry
#

man im sitting here at 3:26 AM with my brain turned off and i havent a slightest idea what the hell are you talking about

long raft
#

i feel like im the only one who knows what anyone is talking about lol

barren quarry
#

i've had experience with c++ but never c

long raft
#

this feels like a stackoverflow post with all negative scores

fickle aurora
#

I mean I could say you are new to programming based on what you said, but I am trying to help you not to make you angry

long raft
#

like saying C doesnt use a runtime, when the runtime is like millions of lines of kernel code

#

or C is low level? is that what they teach kids in school these days?

fickle aurora
#

for the last time, C does not use runtimes... lol

long raft
#

except for the famous c runtime

fickle aurora
#

microsoft has a C runtime for .NET code compiled as C-like, but it is not true C language

long raft
#

there is no true C language

fickle aurora
#

other than that there is no such thing as a C runtime

long raft
#

youre nuts

#

perhaps we're splitting hairs on a standard library and a runtime

fickle aurora
#

afaik GNU C sets the standard for C now in modern day programming, and GNU C does not require a runtime to use on any OS

long raft
#

the operating system is the runtime

#

theres still a runtime, its not raw machine code

fickle aurora
#

so if you didn't have the C++ redistributable installed you could still run .NET C++ programs?

long raft
#

if you compiled a c++ program not to use any c++ libraries, yea

#

same sort of thing with C

#

frankly, you could compile php the same way

fickle aurora
#

C++ redistributable is not an OS, it is literally the runtime

long raft
#

right, its not part of the OS, its an extension

#

but it doesnt compile differently

fickle aurora
#

most of the community calls this a runtime because it literally has to run a second program in the background just to run the main app you want to use

long raft
#

its not running a second program

#

its just running code in a linked library

#

i mean, i see c# is going to be running a garbage collector in the background, i see how thats different

fickle aurora
#

well let's go back to the basics, why did shell32.dll have to run on windows 95 if you wanted to open up most programs?

long raft
#

shell32 is explorer isnt it?

fickle aurora
#

no

long raft
#

oh the shell library

#

i mean the libraries have to be loaded in to be used...

#

since theyre dynamically linked

fickle aurora
#

only the non-standard libraries do

long raft
#

i would make a point that dynamically linking a library is not the same as running another process

fickle aurora
#

it does have to run as a separate process

#

windows 10 simplifies it by using RuntimeBroker

long raft
#

the dll calls in shell32 execute under the process of the program that calls them

fickle aurora
#

and if that process exits, then your apps that rely on it go poof

long raft
#

if the library gets unloaded your program will crash

fickle aurora
#

yes

long raft
#

why would the OS unload the library tho

fickle aurora
#

there is no library needed to run to use printf, you know why?

#

I mean

#

pretty much every CPU, Im even going to say this ATtiny10 that costs 20 cents and is the size of a piece of rice has printf embedded in the CPU as a main function

long raft
#

but it is part of the c library

fickle aurora
#

except it doesn't have to use the library as a reference

long raft
#

youre saying the library is physical hardware

fickle aurora
#

you can directly call the CPU call if you want to

long raft
#

which i ... i just dont think its accurate

fickle aurora
#

the library just makes it easy to read than a bunch of numbers

long raft
#

i ... i cant speak to microcontrollers. i know x86 assembly. and i know there was no interrupt for printf

fickle aurora
#

the standard library is literally all the functions that are embedded inside the CPU

long raft
#

no way

fickle aurora
#

that is why it is called standard library

#

string is not standard hence why you have string.h

long raft
#

malloc is a c library call. it allocates memory. that is not a cpu instruction

#

thats an OS system call

fickle aurora
#

you're right because malloc is not really an instruction

long raft
#

none of them are

fickle aurora
#

but there definitely is an instruction for memory it's just different

long raft
#

i cant speak to every microcontroller, but you know in an intel cpu just calling a function is an instruction itself

#

let alone all the code inside...

fickle aurora
#

malloc can allocate multiple bytes in one go, the instruction only allocates a small amount at a time

long raft
#

theres no cpu instruction that allocates memory to my knowledge

#

theres instructions to move a stack pointer, if you count that

fickle aurora
#

so malloc is really a function that calls the memory instruction multiple times to allocate enough memory

long raft
#

memory allocation needs to be done by the OS so it can manage and remember where the fragments are being used

fickle aurora
#

and what are those OS system calls? how are they made?

long raft
#

the c library

#

passes the request to the OS, the OS handles the memory...

#

im not an expert at modern assembly, but i dont know of a memory allocation instruction

fickle aurora
#

I am asking, what is behind the OS system calls

long raft
#

code

fickle aurora
#

opcodes?

long raft
#

i assume its calling interrupts on the CPU

#

you know, a lot more than single instructions

#

again, speaking to x86 assembly, youd do several instructions to prepare an interrupt, then you call the interrupt

#

so you take some embedded device, but its really running minix or whatever other realtime OS on it, maybe linux or whatever

#

and its got the c library compiled into it

#

maybe im ridiculous for calling that a runtime, but that ... that fits the definition of a runtime to me

fickle aurora
#

so my 64 bytes of memory somehow have the c library in there?

long raft
#

yes

#

on the chip

#

in eeprom or whatever

#

do you literally mean 64 bytes of memory? like wtf is that good for?

fickle aurora
#

I can actually have the thing spit out all the contents of memory and I just see direct CPU calls

long raft
#

and you dont see any system calls?

fickle aurora
#

well it doesn't exactly run an OS

long raft
#

i mean ... are you sure?

#

like every single intel chip has minix on it. it has a full unix OS on it

fickle aurora
#

100% sure on that

#

maybe this is why all programmers need to spend a year and learn how hardware works

long raft
#

...

fickle aurora
#

it will give you a strong clear understanding

long raft
#

mhm.

#

riiiight

fickle aurora
long raft
#

theres not a single memory allocation or system call in that

fickle aurora
#

it is fairly simple really, 2 push buttons and 2 outputs that go to transistors to switch relays with

long raft
#

that code doesnt need to use the c library

fickle aurora
#

no system calls? are you sure?

long raft
#

unless NOP is calling a function, i assume its compiled into a NOP instruction

#

but yes, i can see how that would run without libc

fickle aurora
#

#define nop() asm volatile("nop")

long raft
#

yah that all can be cpu instructions, thats very simple code

#

you could compile C++ to an executable that doesnt depend on a c++ library too with that code

fickle aurora
#

the library is actually just a reference to the boards and the define calls are all direct CPU calls

#

the whole program is shifting bits into CPU registers

long raft
#

but i think if it did a malloc or printf it would have to call libc

#

which i assume is just embedded on the device

#

so is it literally 64 bytes of memory? like wtf thats so tiny

#

not 64k?

#

you cant write much code with like 50 instructions

fickle aurora
#

well it can actually do quite a lot with just a small memory

#

you know how efficiency plays into things

long raft
#

but only 64 bytes?! you couldnt even store a string with 7 characters

fickle aurora
#

if you need to use a runtime, your program isn't going to be as efficient as if it were running line by line of bits shifting into CPU registers directly

long raft
#

it wont be as fast, but its perfectly "efficient"

#

but you likely cannot write faster code than the c library

#

that stuff is rock solid and old and tested

fickle aurora
#

I like this so I can simulate the program inside the IDE and see how it will run my program

#

the red boxes are changes to the CPU register, so a solid red box is a change to value of 1 and an empty red box is a change to 0

long raft
#

why does that IDE look exactly like visual studio

#

is it just made to look that way? or did they license it?

fickle aurora
#

probably because microsoft plagiarized it

long raft
#

...

#

man youve got a weird anti microsoft thing rooted in the 90s i think lol

#

that seriously looks like plugins on top of visual studio or something

#

thats remarkably similar

fickle aurora
#

it's more similar to MPLAB which was the programming interface people used long before visual studio existed

long raft
#

really? do you know how old visual studio is?

#

23 years old

#

man after talking with thecuz1 about vs code, i gave it a try again, i havent used it in a couple years. its still lacking important things i want/need but damn it sure has come a long way. gonna be doing my php development in vscode now

fickle aurora
#

I had to google that one, I thought VS came out in 2004 but apparently there was one version before that

long raft
#

eh many versions before 2004

fickle aurora
#

only one before 2004 according to wiki

long raft
#

well i had visual studio 2002 and 2003, so...

fickle aurora
#

2004 is when C# came out, I was in the Longhorn project on MSDN

long raft
#

maybe im remembering that incorrectly?

#

nah c# goes back to 2000 evidently

#

i wasnt using it until 2002

#

longhorn was uhh .. windows vista?

#

or was it windows 7 ?

fickle aurora
#

vista

long raft
#

there was a lot of hype for vista...

fickle aurora
#

yeah so C# was around before 2004 but it didn't get popular until 2005

long raft
#

depends what you mean by popular

fickle aurora
#

popular as in more than 20 people using it

long raft
#

i dont feel like its ever really gained popularity

fickle aurora
#

microsoft had a massive marketing campaign for it

long raft
#

for .net, not specifically c#

fickle aurora
#

it was supposed to be the first step to going open source at microsoft

long raft
#

they pushed vc++.net really hard, and then killed it like 18-24 months later

barren quarry
#

What's the difference between .net and c#

long raft
#

they didnt really go open source with .net for like a decade or more

#

c# is a language, .net is the runtime

fickle aurora
#

.NET is a framework, like a runtime

#

it is a runtime on top of another runtime

long raft
#

if i were making an analogy to javascript, c# is like javascript the language, .net is like the browser that runs it

fickle aurora
#

C# was great but what makes it bad is multiple points of failure

barren quarry
#

I see

fickle aurora
#

no matter how good you make a program it is only going to be as stable as the runtime

long raft
#

its fantastic as a language, but youre subscribing to object oriented programming and managed memory. for most cases thats a benefit but for some thats crippling

fickle aurora
#

Derp doesn't believe me when I say C# is not a real language, but you can google "why is C# not a real language" to understand why

long raft
#

well frankly you seem like youre making up stuff

fickle aurora
#

imo it is basically something between a shell script and a half baked potato

long raft
#

i think you subscribe to this idea that c# is bad or slow or microsoft and so youll believe things that arent correct

fickle aurora
#

it is because I prefer C or asm for everything

long raft
#

thats fine. we all have our golden hammers, but i wouldnt say C isn't a real language just because i dont like it

fickle aurora
#

they are the only two real languages left

barren quarry
#

Does C have libraries?

long raft
#

yes

barren quarry
#

As in, a package manager so you dont need to invent the wheel every time

long raft
#

most programming libraries are in C

#

no package manager

#

you just have to know how to use stuff

#

your IDE can install libraries for you, if you count that as a package manager

fickle aurora
#

you don't need any packages to run a C program unless it is linked to something else

long raft
#

i bet nuget can do stuff with C libraries

#

yea, if you want to make a C program that doesnt do anything or have any output, you dont need libraries

#

if you attempt to make a program that actually interacts with the world, you will definitely need libraries

#

otherwise youre basically writing your own drivers

fickle aurora
#

but even then, if the C library you linked to directly calls CPU functions (or as Derp says OS system calls which are really CPU calls) then you don't need to worry about runtime or DLL files or any of the sort

barren quarry
#

Like in us you can just hit npm install, spawn a folder with 39000 package files and instantly write whatever you want

#

This is what I meant

#

In js*

long raft
#

theyre not really cpu instructions tho, certainly not on amd64 architecture

fickle aurora
#

here's a big question for ya, is amd64 limited to AMD?

long raft
#

i mean, i try not to work in C anymore, but in my experience there is no legit package management

#

you just have to include the header files in the top of your code, and you have to compile the static libraries in your linking

#

no amd64 architecture was adopted by intel as well

#

its the standard 64 bit architecture on PCs

#

it killed IA64

fickle aurora
#

well there is a second 64 bit standard but not common

#

actually several

long raft
#

not just uncommon, its dead

#

nobody could figure out how to program itanium

fickle aurora
#

intel and AMD aren't the only companies making 64bit CPUs

barren quarry
#

Ok I have a very autistic question I always had

long raft
#

yea this is why i said stadnard PC architecture

barren quarry
#

Why the fuck is 32 bit called x86

long raft
#

obviously not your 64 bit smartphone

#

because uhh ... good question

#

the 80-86 was a 16 bit processor, then the 80-386 introduced 32 bit architecture

fickle aurora
#

x86 refers to the x86 specification for how a CPU should be made

long raft
#

the pentium is a 586, so theyre following the "x86" numbering scheme

fickle aurora
#

it is also proprietary

barren quarry
#

Interesting

long raft
#

its just a model number

fickle aurora
#

it's not limited to intel, but they own the rights to x86 architecture

long raft
#

yah other manufactures have figured out how to copy the interface

fickle aurora
#

remember those "OS system calls" you say, which I refer to as just CPU calls

#

the OS just converts them into the CPU calls for the arch based on whether it is x86 or whatever, but they are still CPU calls

long raft
#

some things are instructions, some things are not

#

if you add two numbers, thats an instruction. if you allocate memory, thats a system call

fickle aurora
#

the OS has to convert if it supports multiple CPU architectures, so if you had a program for x86 you would not want to make an x86 call on amd64

long raft
#

because C is a high level language, its not obvious which things are instructions and which arent

fickle aurora
#

but other than that you could instead make the CPU calls directly in C or assembly

long raft
#

most compiled languages allow you to write inline assembly or IL

#

even c#...

fickle aurora
#

the problem is C# emulates inline

long raft
#

no it doesnt

#

youre just wrong about that

fickle aurora
#

and that's why you dont understand why C# is bad lol

long raft
#

you dont even know how it works

fickle aurora
#

the problem is runtime languages cannot communicate directly to a CPU

long raft
#

first c# compiles to byte code, where it lives architecture indepedent. then when you run it, it gets compiled to your architecture

fickle aurora
#

it's just not possible

long raft
#

uhh i dont even know what youre saying

fickle aurora
#

well if you are managing memory manually then you have to access the CPU directly

long raft
#

the cpu doesnt manage memory. the OS does.

#

this is dumb

fickle aurora
#

and thats where you are not understanding

long raft
#

if i write c# code to iterate over an array, the code will be the exact same machine code if you wrote it in C

fickle aurora
#

OS cannot actually write to memory, the CPU handles that

long raft
#

who poisoned your brain with these ideas?

#

yes the cpu writes to memory, and reads from memory, but the OS manages the memory

fickle aurora
#

you have to make a special call to the CPU to write or read a memory address

long raft
#

the OS does page swaps

#

it does the allocations, the heap walking, the collection of lost memory and freeing it

#

those are all operating system calls, not cpu instructions

fickle aurora
#

they are translated directly to CPU calls by the compiler

long raft
#

you cannot even use heap memory in C without libc

fickle aurora
#

yes you can

#

you sure can

long raft
#

yes, eventually all code is translated directly to CPU instructions, even PHP or python

fickle aurora
#

you just have to do it by assembler language injection

long raft
#

no you cant lol

fickle aurora
#

you make the cpu calls directly with asm

long raft
#

if you made your own assembly to allocate memory, you would be re-writing the c library call for it

#

why woudl you do that.

#

how ... how would you even do that

fickle aurora
#

if you use a C library to do it, then the compiler will convert it to a CPU call

long raft
#

not a single call. hundreds of thousands of calls

fickle aurora
#

you're right you wouldnt do it, the compiler would, but you /can/ do it

#

the thing is with C# you cannot send the calls at all, they are emulated by the runtime and sent that way

long raft
#

no they arent

#

stop saying that, youre wrong

#

open up a book

#

go read how bytecode works

fickle aurora
#

that is why C# has to be "interpreted"

#

that is the whole purpose of a runtime

long raft
#

c# is not interpreted. youre just simply wrong.

fickle aurora
#

and this is why theo de raadt does not use C#

long raft
#

Because he doesn't google?

fickle aurora
#

well the thing is, C# is great for beginners, when you see the light you move toward C

long raft
#

i mean i dont see c# working for your device, but it does exist on embedded devices, ya know like an arduino, and its definitely not interpreted

#

bruh i was mastering C before you knew how to type

fickle aurora
#

then after you learn C you start building your own 8 bit computer to understand how and why a computer works

#

C# does not exist on embedded devices because it relies on runtimes

long raft
#

C is an awful experience, unless you have to use it and thats your only option, and its really not anymore

#

yea i agree with that, although its on some embedded devices with the runtime

fickle aurora
#

arduino is a bad example, it is basically the microsoft of the microcontroller world

#

it is bloatware

long raft
#

no true scotsman huh?

#

its a bad example because its counter to your "none" argument

#

c# is a language for professionals. C is a language for chinese programmers and hobbyists (not racist, you know micro architecture is all getting made there)

#

java too... professional

#

C++ still relevant anymore to anyone besides game programmers?

fickle aurora
#

well apparently it's relevant to foxhole

long raft
#

maybe disk uses c++ for embedded programming

#

yah i think ... i think C would just be too difficult to build a large project in

#

when i started game programming it was pretty hot, lots of people were using C/openGL

fickle aurora
#

how would C be too difficult? Factorio was made in C

long raft
#

and c++/opengl, i think all the C games/engines are dead and gone

#

was it really? wow.

#

a quick google says c++ tho

fickle aurora
#

yes, why do you think it was such a smooth running game

long raft
#

can you cite a source?

fickle aurora
#

it has crazy amounts of entities on screen with no lag even on a potato

#

that is my first source

#

my second source is the fact it uses a C game engine

#

it all comes down to efficiency

long raft
#

C++ could use a C engine you know

#

i could use a C engine with C# too

#

i dunno i cant find anyone saying it was written in C, i see it was written in C++

fickle aurora
#

well most C programs are compiled with a C++ compiler anyway, you're right about that

long raft
#

" The game engine itself is pure C++ because of (1) performance reasons and (2) it's the programming language the devs are most familiar with."

#

im glad im not betting my life on your claims

fickle aurora
#

Allegro is a C game engine

long raft
#

but factorio is written in C++

#

i dont understand this claim that factorio runs smoothly, it doesnt for me

fickle aurora
long raft
#

and the language choice doesnt matter at all

#

its not like the tiny amount of code written in the game logic will have any bearing on speed compared to how many triangles its trying to draw

#

ok im not arguing allegro. all the sources say factorio was written in c++ using allegro

#

so ill go back to my point i guess, its too hard to make big projects in C

#

javascript, like C, is such a slim language, it just doesnt have a lot of features for managing big projects well

fickle aurora
long raft
#

ok but that doesnt .. say factorio was written in C, i think you just made that up because allegro is

#

you know my C# code uses a lot of C libraries but i wouldnt say my programs are written in C

fickle aurora
#

the game engine is the biggest performance hog in most games

long raft
#

the rendering, yea

fickle aurora
#

that's why it being made in C is very significant

long raft
#

why do you think that would make it faster?

#

the rendering is done by the graphics library, not the game engine

#

so vulkan/directx/opengl

fickle aurora
#

quite frankly because it does not use C++ or C# redistributables as I tried explaining the whole idea around runtimes

long raft
#

this is why you can write games in c# and python and stuff easily

#

and they have nearly similar performance

fickle aurora
#

python would be horrible to write a game engine in lol

long raft
#

it would be fine

#

again, the heavy lifting is done by the graphics library, not the game engine

fickle aurora
#

you would need probably 200 gigs of ram just to run it

long raft
#

this is nonsense

#

man you are really red pilled about C, itll fade in time

#

when you work for weeks on a hello world and realize your time is worth more

fickle aurora
#

each language has an intended use really, python/php/java were meant for client side web applications

long raft
#

python a client side web application? wut

#

php doesnt even run client side

#

youre just trolling me now

fickle aurora
#

C was intended to make building an OS easier compared to assembly

long raft
#

ok i finally figured it out, you got me

#

in shame ill go back to foxhole

fickle aurora
#

what I mean by client side, is you never see a program written in PHP that opens up a socket, it is intended to produce web pages which are a client side object that is transmitted by a server to another client

long raft
fickle aurora
#

yes you can make sockets in php, I have personally never used a program written in php that opens a socket

long raft
#

other people do

fickle aurora
#

I have however used apache php extensions which do not make sockets

long raft
#

many people use php as their scripting language

fickle aurora
#

apache is the software that makes the socket, php is just interpreted by the server software and generally used to produce an interactive output to a web page

#

outside of using php as a module in a web server to produce interactive web pages, there is practically nobody making anything popular/widely used in php as a server program to host

#

python actually has quite a bit of things made because it's more efficient than php, but the problem is that you still need a runtime/interpreter for it, just like you need a runtime or interpreter for C#

#

a big question to you is, if you think C# is not an interpreted language, then why is mono needed to run any C# program on a non-windows machine? (of course windows has built in support for C# since it's a microsoft proprietary language)

#

java also needs runtime support, ie: JRE, though, I don't need any runtime installed to run most C++ programs and none needed for any C program

long raft
#

mono is the runtime. you need the libraries. its not interpreted

#

seriously, it would take you like 3 minutes to google it

fickle aurora
#

runtime is an interpreter

long raft
#

theres not a source alive that would say its interpreted

fickle aurora
#

well there are plenty of sources in paperback

long raft
#

the runtime includes a compiler used to compile it to os-native instructions

#

it has never been an interpreted language

#

there will be no printed book that says so

fickle aurora
#

it is unfortunate that the Internet is a place where the majority have a voice that is bigger than the voice of any engineer

long raft
#

perhaps said engineer doesnt know what hes talking about

#

maybe the majority simply is right

fickle aurora
#

Brian Kernighan is the guy who invented C and helped invent C++, I wonder what he has to say about C#...

long raft
#

youll find the same arguments about java, which are slightly more relevant

#

uhh

#

where do you get your facts from

fickle aurora
#

I get my references from books written by the engineers who made the languages - why - because who else would you get your information from?

long raft
#

dude i dont want to play your C is better game, i just dont care

#

im just getting triggered with all the incorrect facts

fickle aurora
#

it's just my opinion, but I believe nobody is truly able to write programs in any language with comprehension about what they are really doing until they have started from the base, which is assembly or at least C

#

there are other base languages like B, but you would probably need to make an 8 bit computer or buy a kit to start with a language lower than asm

#

Brian's book on the C language from 1978 is still in print by Pearson ISBN: 0131101633 ISBN13: 9780131101630

long raft
#

i dont uhh...

#

i know C. youre gonna have a hard time convincing me its the best

long raft
#

I'm not convinced at all, but I'm glad I watched the video

#

its clearly important to him as a embedded software engineer

#

what he wants is ... a glorified set of macros for assembly with reverse polish notation in a language

fickle aurora
#

linux is far from an embedded OS, I mean, it works on some RISC processors but it's too heavy to run on any AVR

long raft
#

thats his job title

fickle aurora
#

and yeah I was victim to windows update again

long raft
#

does a raspberry pi count as embedded?

fickle aurora
#

microsoft's response is to tell me that my computer is not compatible with windows 10, but in reality it's the bloatware and automatic driver updates killing it

long raft
#

you know we would have counted a car stereo as embedded device like 10 years ago, but a raspberry pi is way smaller

#

probably similarly expensive

fickle aurora
#

they want me to buy windows 10 workstation edition for 125 bucks... lol

long raft
#

my friend programs satellite dish receivers and is considered an embedded device programmer

#

uh

fickle aurora
#

yes those would be

long raft
#

there are many sites you can get a working copy of windows 10 for 15-30 USD

fickle aurora
#

raspberry pi is not really embedded

long raft
#

why isnt it embedded? because its not strictly limited?

fickle aurora
#

it's considered a full computer

#

embedded would be like an ATM machine or cash register

long raft
#

but its literally a ... circuitboard, especially with like the pi zero

#

i know it has all the components, but when you can buy these for 10 dollars and theyre that small, why arent they embedded

fickle aurora
#

typically ATM machines still run COBOL because of the efficiency and ability to directly access CPU registers and such

long raft
#

if i were building a hardware device now, i think i would rather build it around a small pi device

fickle aurora
#

raspberry pi is a full all out computer that's the difference really

long raft
#

right but so is my calculator

fickle aurora
#

you can't run an operating system like windows on most embedded microcontrollers

long raft
#

i dont see where the divide is

#

can i run windows on a pi?

fickle aurora
#

there was at one time a version of windows called Windows Embedded but that is not even the same kind of category as a windows OS

long raft
#

isnt it an arm device? i dunno if i can run windows on arm or not

#

i havent seen anyone running windows on their pis

fickle aurora
#

don't know never tried it, but windows probably might not have ARM support

long raft
#

i would bet money its possible, with some weird limitations

#

people are just using pi's instead of embedded devices because theyre so much easier to develop for

#

and theyre inexpensive. theyre filling the same slot

fickle aurora
#

the reason linux can run on it is because the operating system is open source and that meant people were able to modify it to run on ARMv7/ARMV8 etc

long raft
#

i dont understand what makes something embedded or not - surely not just its capability

#

there is an arm version of windows

fickle aurora
#

embedded is basically something that uses a real time operating system instead of a regular OS

long raft
#

hmm

#

ok thats pretty clear at least

fickle aurora
#

so basically my example of the ATtiny10 is not embedded either really since it can't even run an OS, or at least you would not have enough memory to run one, and it cannot do complex math calculations either

long raft
#

but you know, linus really is a real-time guy.

#

if so, then embedded device programmer would fit

fickle aurora
#

embedded still uses an OS but a real-time OS, in that it can run apps but cannot multitask them the same as a normal OS can

#

most AVR/PIC/STM32/etc could run a real time OS

long raft
#

yep, familiar with real time os

#

ok ok so if i put a realtime os on my raspberry pi then is it an embedded device?

fickle aurora
#

you would have to burn it to the firmware on the chip as that's how embedded OS is run

long raft
#

why

#

lets suppose i make the disk read-only

fickle aurora
#

raspberry pi has its own firmware that manages how it boots, so instead of running an RTOS from the firmware it has firmware that searches the SD card slot for a regular OS to boot to

long raft
#

but its real-time from there

#

this is so people cant hack it? like put linux on their playstation 3?

fickle aurora
#

if you put an RTOS on the disk it won't even boot because it's not a regular OS, usually RTOS is a hex file or machine code type file that you have to burn to the chip as firmware

long raft
#

theres real time OSes for raspberry pi

#

theres a handful

fickle aurora
#

if they aren't firmware they are just acting like an RTOS

long raft
#

i dont see the distinction

fickle aurora
#

because RTOS is where you directly manage the CPU

long raft
#

if you could define "directly manage"

fickle aurora
#

directly manage as in, you have to get the manual print copy or PDF of the cpu and search what the programming of the CPU requires you to send and what kind of signals to send, the timing of the signals and which pins to send them to

#

and of course which protocol, since there are so many protocols

#

ICSP is the most common probably, ATtiny uses TPI protocol to program it, that is, a protocol which outlines what pin to use for what function and the type of sine wave/digital pulse to send to it to make the CPU store data in its firmware

long raft
#

you wouldnt let the compiler do that?

fickle aurora
#

compiler makes the machine code for it but you could theoretically write out the opcodes and hex yourself

long raft
#

why

#

i mean isnt that the compiler's job?

fickle aurora
#

well if you want to torture yourself

#

the thing is most of it in C is already basically opcodes

long raft
#

i assume if you control the kernel then your compiled os would be doing all of those things

fickle aurora
#

all those DDRB and PORTB commands you saw in my code are basically opcodes which are like for example digital signal representations of let's say 0xc0 which would be an instruction for something and then you pass a value after that instruction which would be the data for the instruction to process

long raft
#

yah thats just like kernel code

fickle aurora
#

the compiler converts it from "DDRB" text to the proper opcode

long raft
#

when you made the distinction of realtime os, i thought yea i can see how the software determines if something is an embedded device

#

so i would think yea if it has a real time os on it then its embedded no matter what

fickle aurora
#

the program that is used to upload the hex code tells windows how to tell the programming device how to program the chip, and the programming device translates that into pulse/sine waves at specific frequency needed to program the processor

long raft
#

right, i get that programming the chip is harder

#

but thats no different than punch cards vs a keyboard for making software

fickle aurora
#

the signals have to be precise which is why a human can't just touch a pin to another pin to do it, they often have precise timing and thats why everything in the end uses a crystal oscillator for perfect timing

long raft
#

but youre saying the difficult manufacturing process and a real time os is what makes it an embedded device

#

i dont see why the manufacturing or printing or programming process changes it

fickle aurora
#

it's the fact that since it directly controls the CPU, there is no latency, that's really where the advantage is

long raft
#

if it was a real time OS, then it would have no latency

fickle aurora
#

the other big advantage is power savings

long raft
#

it would have deterministic latency, i mean theres always latency

fickle aurora
#

another huge one is it uses far less data

long raft
#

ok but low power cant be what makes something embedded

#

because whatever ... current you say is the limit, im sure the raspberry pi will get there

#

im not arguing its more efficient

#

just that its affordable enough to replace them, and its much easier to use

fickle aurora
#

this is also why stuff like OpenWRT is inferior compared to just buying a real router, because it runs on top of an OS like linux so it loses out on efficiency compared to an embedded system that directly controls everything with no bloatware in the middle

long raft
#

well that stuff used to be expensive

fickle aurora
#

also there are security issues with stuff like Linux, if you have an embedded program that is set by basically sending a pulse wave to the CPU, how is a hacker going to reprogram it?

long raft
#

but also if theres a security vulnerability in an embedded device how can you patch it

#

like old nintendo games printed with all the bugs

#

that argument has a flip side.

fickle aurora
#

generally once they are programmed they are never reprogrammed again, but they allow external data to be added via SD cards or whatever

long raft
#

theres security issues everywhere, no OS or especially IoT devices are reliably secure

fickle aurora
#

heck some can't be reprogrammed, I can send my code to microchip and have them burn the program onto my ATtiny10 with no option to change the program, and for 500 bucks they will encrypt the machine code so it can't be copied by reverse engineering

#

yeah IoT have issues mostly because they have telnet servers running on them which is a huge joke

#

but also that is because they are often running a full OS like linux

long raft
#

well because they arent servers, theyre all developed as clients and they connect outward

#

vulnerable to man in the middle attacks, theyre not using SSL well or outdated certs

#

and theres a data stockpile on some remote server that can be stolen too

fickle aurora
#

usually hackers can't do anything to embedded firmware, it's the add-on software they target