4 ms·
Higher level languages are based on lower level languages. aka Have to manually do more things in lower level language to get the 'built-in' features of the hig
by sargstuff 5y ago
Higher level languages are based on lower level languages.
aka Have to manually do more things in lower level language to get the 'built-in' features of the higher level language.
C is a system/software engineering language, not a data science/"I don't do/use low level OS/HARDWARE stuff"/someone else needs to write the higher level stuff I want to use" language. So, using C as a scripting language, implies implimenting a scripting language in C first.
(vs. https://hackernoon.com/javascript-compilation-epoch-ebfb7b5bb664 https://hackernoon.com/javascript-compilation-epoch-ebfb7b5b... )
C is basically assembler language macros.
Thre are many types of binary encodings.
Binary format consists of sequence of 0's & 1's, any order,
usualy arranged in groups of 8 0/1's.
Standards are used to define how a binary format encoding is interpreted/used/defined. UTF-8, UTF-16, UTF-32, ASCII, etc.
notes on https://hikari.noyu.me/blog/2022-04-01-javascript-is-a-safer-language-for-integer-programming-than-c.html https://hikari.noyu.me/blog/2022-04-01-javascript-is-a-safer...
"... JavaScript has exactly one integer size supported by its integer operations: 32bits"
Umm... on a 64bit machine, wouldn't this rehash the x86/dos/windows 80's/90's 8/16/32 etc issues?
number is 64 bits & bigint goes beyond 64bits.
JavaScript can no longer safely represent integers.
Bit operations are implemented as a cast to an integral type followed by a cast back to a double representation. It is therefore not a good idea to use bit-level operations in Javascript.
C language is not the same a C math library!
Can check for NaN via appropriate C math library function.
C base type is integer. All other types are based off inter type, so can bittwiddle the base type to change endianness.
Is there an ASN.1 java script defined using C?
https://developer.ibm.com/articles/au-endianc/ https://developer.ibm.com/articles/au-endianc/ && https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html https://commandcenter.blogspot.com/2012/04/byte-order-fallac... So, if C code isn't endian neutral, and endian-ness matters, better do the order check.
Can explicity define type width in C via bit enumeration without switching to assembler.
Struct layout is not endianness!
And one can explicity specify ordering of variables in a C struc (vs. default of letting the compiler decide and/or writting the equivalent assembler code)
Removing integer inodes with javascript is "safer" than using C? aka how does javascript impliment a hardware static electricity protection device?
High-level scripting languages are written in C. So, how can C functions that the high level scripting language uses be slower than the same C functions the high level script language bases it's functions on?
Certainly higher level programming language by default takes care of details behind the scenes which would otherwise have to explicitly write out in C. (per difference between high / low level language)
C was built for speed. If want similar checks/guardrails that javascript provides, use/add/program the correct C tool/feature (aka compile time, run timchecks, lint tools, aditional code that someone wrote in C for the higher-level language)
Scripting languages were setup so can focuse on specific domain aspects/tasks and not how to impliment the language aspects. (typical emphasis is ease of use and immediate execution )
https://web.archive.org/web/20041010125419/http://www.doc.ic.ac.uk/~np2/patterns/scripting https://web.archive.org/web/20041010125419/http://www.doc.ic...
- sargstuff 5y agoUsing text because it's better than binary format? human readable doesnt not mean the text format is unambiguous. aka don't preform checks/validations because not specification of what to check/validate see https://seriot.ch/projects/parsing_json.html https://seriot.ch/projects/parsing_json.html && https://news.ycombinator.com/item?id=28826600 https://news.ycombinator.com/item?id=28826600 just as messy as ambiguously specified ASN.1 binary formats. Very important to know the requirments/specs for what's being implimented!