It's syntax isn't much different from so many other languages though? Most notably just making datatypes optional and replacing curly brackets with indents
Okay but you're just talking about built-in functions that aren't necessarily python specific, if you really needed a sum and range function to be abstracted from your code why not just write your own math library and import that? (I don't wanna Google a ton about libraries in other languages but it probably already exists)
I just gave you an example of what you could do in C if you really needed them abstracted from your own code but it would only really matter if you write bigger programs, you know, you wouldn't write a whole sum function to use it once
Sure I know what list comprehension is, for reference i primarily use python myself, but you're just using a built-in function which could have been expressed in a more readable format as you've literally shown yourself
I've had a lot of classmates get very confused by a long comprehension where I've had to rewrite it as a normal for loop to explain it
The nly real advantages I can see from using comprehension is it's speed as I'm pretty sure it is compiled as a single line and that it is easier to pass to numpy
C is not a good language in a number of ways, many of which are due to performance and resources constraints in the context of its original creation. Its design is not conducive to writing secure or high-reliability software, and any such software written in it is done in spite of its design flaws (and because network effect has made it so that for some platforms proprietary C compilers are the only vendor-provided compilers available at all - so even now you need something that you can at least cross-compile to C to write for them).
Python is an interpreted scripting language, which is generally too slow to reasonably write a useful kernel with (you really want native binaries), it also lacks a certain level of low level access that can be useful in writing an OS. But most importantly, Python lacks a stable standard you can rely on to write your OS, so you're basically relying on some arbitrary canonical implementation that provides you with no long-term guarantees (and it has done many breaking changes in minor version changes, I've had to deal with them at work). Python was [very new](https://en.wikipedia.org/wiki/Python_(programming_language)#History) and unstable when Linux was first created. C++ likewise lacked a standard back then.
edit: The importance of that network effect (and thereby portability) is also part of why projects like seL4 bother with writing their microkernel in C despite the fact they really wanted to do it in ML (iirc).
View all comments
Show parent comment
4
u/Mast3r_waf1z May 30 '22
At this point why don't you just write C tho?