5 ms·
I get little pink dots around the face when I see the sentences like this: > alternatives to C and C++ such as Python, Rust, Go, Clojure, Haskell, Swift Pleas
by stiray 7y ago
I get little pink dots around the face when I see the sentences like this:
> alternatives to C and C++ such as Python, Rust, Go, Clojure, Haskell, Swift
Please advise me. I am just writting a kernel module for hooking kernel calls and I really """hate C""", I would love to do it in python (even better in js or vbscript, logo also comes to my mind - i just love driving a turtle). The input is python, the output .ko.
And as normal for kernel module it needs to be rock stable and as fast as possible as the hooked functions are called a lot on the system and cant loose much time there.
Can you share a sample please? I am thinking of doing it in bash script by emitting opcodes directly but it seems like it just take too long to dig out all opcodes. Yeah, I know what you think, but it is not assembly, it is bash script.
/sarcasm off
- pjmlp 7y agoYou could start with Circuit Python, Nim, and go from there. I for one get dots when keep seeing people with lack of vision.
- stiray 7y agoSorry to hear that. I need efficiency and speed with lowest possible memory footprint. You know why? As I dont want you to complain that my software is hard for your system requirements and using it costs you twice the price in your favorite cloud as it is wasting resources that it doesnt need to waste. Not to mention coredumping a kernel from time to time due to a bug in python interpreter. I will just stick to my hated "C". Anyway, you could try to persuade Torvalds to write linux kernel in C. Or rather join the freebsd forums and share the python kernel idea to the people there, I am sure they will apriciate it. Please DO share the responses, as they will surely love your visionary skills, not to mention cloud providers that will earn some extra money... /sarcasm off(again) Anyway not every software is suitable for any task. And at some times you do need knowlidge about what you are doing, including memory (which seems such a "born after 2000" nonpassable barrier as it is so hard to calculate how much memory you need and when to deallocate it at the cost of throwing money in form of cloud resources over the window). /sacracsm really_off
- pjmlp 7y agoI already joined the Apple and Microsoft cathedrals, which have better alternatives in place for C.
- stiray 7y agoGuess what, I am also proficient in writting NT kernel drivers - I love their kernel btw. Maybe you can start by sharing your visionary skills with Microsoft. Or maybe Apple (but do try freebsd forums first, Apple and Microsoft might ignore you, but I know there will be responses there - maybe, just maybe, head to bsd kernel development mailing list directly). /sarcasm ooooooooofffffff
- ChrisSD 7y agoMicrosoft writes much of the kernel in (msvc) C++ but they're keenly investigating other languages. They're also researching designs for new ones. C isn't the only game in town.
- pjmlp 7y agoIn case you missed the message, C is deprecated on Windows, any updates beyond C89 are done as side effect of ISO C++ compliance, and UWP, including universal drivers, is not going away no matter how a couple few might hate it. BSD is becoming irrelevant in world at large, so that would just be a waste of time. In any case, the bazaar has proven that it is only technically able to produce UNIX clones.
- dang 7y agoPlease don't post in the flamewar style to HN. It's destructive of curious conversation, which is what we're going for here. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- Phrodo_00 7y agoThe other bit is that when they say that some language is not a good fit for current processors, that also applies to x86_64 Assembly, that provides no way to control certain ways the processor works, like pipelining, that would be pretty interesting for a compiler to have access to.