Moving asm.js interpreter to the kernel

now that multiple c to j.asm compilers exist, and of course any language really can do this. why not just move a javascript interpreter into the kernel and forget native code entirely

it's the most popular language with the most powerful modern oop opensource codebase.

portability would be solved forever and we can really do what we've been flirting with for years now, this is obviously what we need

browsers are the portal to 90% of average users programs, this can finally end this and make the computing world make sense.

Q1. Won't this be way slower than C or something?
WRONG! asm.js is approaching C speeds even with little investment being done so far, infact C compiled into asm.js is actually faster than Clang compiled code for box2d game engine.
Source: hacks.mozilla.org/2013/12/gap-between-asm-js-and-native-performance-gets-even-narrower-with-float32-optimizations/

Q2. what about vm overhead! it can never truly be as fast!
WRONG!. Infact according to a study by Microsoft a shift to virtual memory protection instead of hardware based irq we can increase speed by 25 - 40%
using a conservative 80-90% vm overhead we can actually gain a modest speed increase with our new kernal j.asm interpreter
source: research.cs.wisc.edu/areas/os/Seminar/schedules/papers/Deconstructing_Process_Isolation_final.pdf

Q3. Won't this be insecure!
WRONG! how often does javascript break out of sandbox today? Anyway. libcurl is written in one of the most insecure and outadted languates ever C, with no garbage collection and shitty manual memory management its practically a joke in the security world; yet libcurl is constantly and exhaustively searched for issues and therefore remains relevant even now
source: daniel.haxx.se/blog/2017/03/27/curl-is-c/

so Sup Forums, is it time to dump native code and move everything to the worlds most popular language?
I say yes

Other urls found in this thread:

bugzilla.mozilla.org/show_bug.cgi?id=933001
github.com/redox-os/
runtimejs.org/
bellard.org/jslinux/
en.wikipedia.org/wiki/Undefined_behavior
research.cs.wisc.edu/areas/os/Seminar/schedules/papers/Deconstructing_Process_Isolation_final.pdf
twitter.com/SFWRedditVideos

C combined with JS is worst possible thing I can think of.
Joseph Mengele would be like 'Damn son even I wouldn't go that far'

not an argument

is this the new Marie thread

yes

nice

uhhh Sup Forums ur supposed to reply to this thread

which gpu will get me the best fps in Marie rose simulator

>this thread again

not an argument

"You want to be put down like a 1st uni bitch again, then remake the thread and see how smart you aren't, you fucking pleb"

hit me with your best shot kid

oh I know why no ones replying
its because they're all too busy reading my sources :thinking:

Fat chance of that happening now that WebAssembly is a thing.

Face the truth: asm.js is doomed.

Also, js is single threaded, so you're shit out of luck if you want multithreading, which is pretty much a requirement for a kernel.

I'd compile my compressed javascript bytecode into her unsecured kernal if you catch my drift ;) ;)

WRONG
bugzilla.mozilla.org/show_bug.cgi?id=933001


haha

delet this right now

"SharedArrayBuffer is a component in an experiment to support multithreaded codebases using pthreads in Emscripten. The buffer functions nearly identically to an ArrayBuffer"

btfo

That's neat, but is it standard? Hell, even asm.js isn't properly standardized like JS or wasm. That pretty much defeats the whole appeal of it being JS.

What problem are you even trying to solve with this?

when the most popular language on earth with the largest codebase becomes standard cross platform then there are obvious advantages

the problem of not even being able to mention a creative idea without Sup Forums calling you a retard because they think literally everything they read on Sup Forums is 100% fact and that real life is memes

this

Didn't we have this thread yesterday?

animetard get back to your containment boards now

we're going tohave this thread every single day until someone disproves me or linux and osx replace their kernels with javsascript

theirs nothing wrong with the macOS colonel ty

>6 unique posters before
>6 unique posters after
Nice

Maybe if you stopped samefagging on a mongolian story quilt website, and actually built this thing, people would care. I fucking love JS, and would love to see that get built, but unless it's either built or would solve real problems for me, I honestly don't give a shit and will happily poke holes in your idea all day.

your dumb, dont reply to me

>will happily poke holes in your idea all day

go on then lol

>js is single threaded
uninformed tard

Prove me wrong with a standard js feature. People have shoehorned it in, but it's not in the language standard.

Get your shit straight

obviously they would use the already developed base to add multithreading to the kernel version of javascript

>"""""""""""standard feature""""
>on a language that's evolved over decades
>just like how C++ and others get language updates and has for decades

Yeah, this really shows what an ignorant fool you really are. Not responding to you anymore. I pointed out how stupid you are, and there's nothing else worth saying.

Lmao. Imagine not being able to do proper functional programming in C++ after people finally realized that making everything a class was a fucking mistake.

>why not just move a javascript interpreter into the kernel and forget native code entirely

I don't think you've written a kernel, or any kernel-level code, before. If you did, you'd recognize why this isn't feasible. JavaScript doesn't have the right semantics to do what a Kernel needs. JavaScript does not have the semantics to represent "write this value to this physical address". It does not have the semantics to inline assembly where necessary either. Beyond this, it does not have a real integer type. All of JavaScript's numbers are double precision floating point, although the V8 engine can handle some operations using native 32-bit floating point numbers. But most consumer CPUs these days have 64-bit instruction sets, so you have to operate on 64-bit pointers. How do you expect to manipulate a 64-bit integer value in a language that cannot operate on 64-bit integers?

You're not asking the right questions here. You keep thinking about performance. Sure, performance is important in a kernel. In fact, you should expect that every single cycle counts, because this is the son of a bitch that has to handle your I/O operations, and you don't want your read or write operation to take any longer than it needs to. But before you can even begin to address questions of performance, you should ask yourself: can my language talk to the hardware in the ways I need it to? The answer, of course, is no. Anything you build here is going to be a hack relying on a lot of assembly and/or C code that your JavaScript code is going to be talking to. At this point, you might as well just use C. Or C++. Or Rust. Even Ada is fine. Use something that was designed for this. Don't try and cut a piece of paper in half with a ball peen hammer.

>so Sup Forums, is it time to dump native code and move everything to the worlds most popular language?

You literally cannot drop all native code. Even the so called "Java OS" I sometimes see dropped into these sorts of discussions relies on assembly.

>obviously
>they
Who the fuck is they? Which multithreading implementation are they going to use?

wtf

haha I didn't read a single word of this

Go take a class on kernel programming. Write an actual kernel, or at least something kernel related, like a driver, or a CPU/IO scheduler or something. Really, just learn what the fuck a kernel does.

Then go look at the specifications for ECMAScript, and tell me if this language is in any way practical for the tasks associated with a kernel.

And when you finally reach enlightenment, you can kindly fuck off with your delusional ideals of running JavaScript in ring 0.

JavaScript isn't even the most popular language

Finally someone with a fucking brain.

Sucks that your post will get ignored because you're a tripfag and tl;dr. You're 100% right though.

didn't read this one either

what about inline assembly in js though
even dynamical generated

sorry you wrote all that out only to be outdone by an anime girl once again

haha

Have you started building this yet? I think it sounds cool.

Who care about the topic. Post more Marie OP

bump

>what about inline assembly in js though
JavaScript does not support inline assembly. It is not a language feature. You cannot write inline assembly in JavaScript, and have it executed by a compliant interpreter. And even if you could, the shortcomings of JavaScript for the purposes of writing kernels are so great that your program would consist of more inline assembly than actual JavaScript code. You would fail to achieve the portability that you desire.

Fuck's sake, if you want to start proposing a new language for kernel development, you should at least recommend a language actually suited for the task. Rust does the job just well. For fuck's sake, just look at this beautiful son of a bitch:

github.com/redox-os/

The kernel is written in Rust, the coreutils are written in Rust, the shell and graphical user interface are written in Rust. There's a little assembly for the bootloader (you really can't get around this), but pretty much everything else is Rust. The only C here is for a GCC and libc port, for those who might want to write Redox OS applications in C.

please quote my psots when you reply to people otherwise i cant tell who ur talking to

Forgot.

the kernel could be written in c and run a ring 0 JavaScript interpreter as is here:

runtimejs.org/

all processes are run in ring 0 and safety insured by vm just as I prophesied

bellard.org/jslinux/


how come anime girls are always right

I came in here for the Marie.
I left because of Javascript in the kernel.

Because js is garbage

not an argument
inb4 some dumb post about dynamic typing

Dynamic typing is fucking garbage and useless.

the whole pointof this thread was to condescend to the retarded morons who post on Sup Forums, but you've obviously proven that you're superior

so you dont have to reply anymore, sorry for making you type so much. you win.

everyone else is still retarded though

lol

>inb4
That's not an argument
Have fun with all the kernel crashes because of the runtime errors you couldn't catch

haha

your hunger for cock is slipping out, user

Not an argument

>ring 0 JavaScript interpreter
[Sound of CIA and NSA hands rubbing together intensifies]

en.wikipedia.org/wiki/Undefined_behavior

>The behavior of some programming languages - most famously C and C++ - is undefined in some cases.

hmmmm

Just fuck off and kill yourself already.
Your stupid idea is retarded and uninformed.

Okay?

tell me why in your own words

Yet C, C++, and especially Rust still manage to catch many more errors at compile time than Javascript can.

c and c++ are litteraly famous for undefined behaviours yet you meme javascript as being bad 'because dynamic typing'

Didn't you read anything Ruby said? As a kernel programmer I can confirm that he is 100% fucking correct.
Oh that's right, you didn't read any of it, you just "tl;dr lol"'d through all of it.
Kill yourself.

you cant just piggy back off of the one intelligent poster in this thread and excpect me to respect you lol

*beats u up

I also don't understand why you'd think js would bring any kind of improvement

Why do you conveniently ignore it though?
He's right. So fuck off and delete your thread already.

>that image
how is that even acceptable?

1. true absoulute super portability between all operation systems

2. harnessing the pwoer of 10 billion pajeets because javascript is the worlds most popular language with the most development attention

3. pissing off manchildren on Sup Forums

you're too retarded to astertain if he is right or not, so you dont count

Avatarfagging is against the rules.

it's not avatar use if more than one person itt are posted marie rose which the moderators can confirm

Why are you so autistic?

>true absoulute super portability between all operation systems
That's not exclusive to js, mind as well just use Java then. At least it won't do the dumb shit you see in my picture
Your other two answers aren't actual arguments

Or you could write the kernel in C, and let JavaScript stay in ring 3, with the rest of the user-land applications.

we're moving it to ring 0 for 30% speed increase

tumblr/erp tier retard

not an argument

Running in ring 0 doesn't improve speed at all. All it does is allow it to execute privileged instructions. It is exclusively for the kernel to do things like swapping out page table entries or talking to the hard disk.

research.cs.wisc.edu/areas/os/Seminar/schedules/papers/Deconstructing_Process_Isolation_final.pdf

wrongo bongo

Did you even read the paper? It doesn't prove what he said wrong at all

"hardware based isolation incurs non-trivial performance costs up to 25-33% and complicates system implementation"

this thread is for retards only please stop replying

I want to FUCK Marie Rose !

What does that have to do with the role of ring 0 and your perceived performance increase of moving software into it

>this thread is for retards only please stop replying
How fucking retarded are you exactly? How about stop conveniently ignoring the people who are actually making good arguments against you?

Are you basically admitting that what you're trying to convince people of is fucking stupid?

seriously?
we are removing trap interupts , switching to ring 0, and switching VM tables from everything

hardware based isolation, protection rings ect is a non-trivial performance cost.

but that wasn't a good argument and my paper proves me right

It actually is an argument.

not an argument

Marie is an overrated coal burning whore.

delet this / not an argument

wtf delet this her chest isn't that big

>error you cannot delete a pos tthis old
sorry

> coal burning whore.
Nothing wrong with that if she's still young and pretty. Only makes my chances higher.

gross gtfo out of this thread

Code campers are cheap. That's all you average MBA middle manager cares about. When they need something to actually work, they'll just hire an outside consultant.

>When sleeping women wake, mountains move
Are they trying to say that all women are fat?

and now he's spouting pol memes
fucking crossboarders

moron