Boot a linux kernel right inside your browser.
241–250 of 255 posts
Re: Boot a linux kernel right inside your browser.
#242Re: Boot a linux kernel right inside your browser.
#243I don't know what is the problem of the original 2.6.20 linux kernel with JS/Linux but with this new compilation work perfectly.
Re: Boot a linux kernel right inside your browser.
#244Earlier quoted context omitted.
I've always wished that, instead of a "browser language", browsers exposed a LOW LEVEL bytecode environment (which browsers are then free to interpret, JIT compile or on-the-fly AOT compile at page load time). It should be reasonably low level, in that it should provide an abstraction from the hardware, but still allow for very efficient execution of lower level code. Then high level languages and frameworks could be…
Factor, Racket, and Lua all have ffi's that are very easy to use. I've never quite liked Lua's metaprogramming, though (macros are very useful when you're writing bindings.) and my least favourite Lua quirk would be the lack of integer types - both other languages have fairly sane (and performant!) numeric towers. That said, I'd give a higher priority for the language in my browser to be safe: some kind of correctnes…
local ffi = require("ffi")
int = ffi.new("int")
int = 10
print(int)
I also don't find the lack of macros in Lua as limiting as I do in other languages. For example, if I wanted to create an EDSL in Lua, I would have it parse a string at startup. For example, imagine a state machine DSL: fsm = my_dsl[[
start: foo
stop: quux
foo -> bar
foo -> baz
bar -> foo
baz -> quux
]]{ foo = function()
code for foo here
end,
bar = function()
code for bar here
end,
baz = function()
code for baz here
end,
quux = function()
code for quux here
end
}
fsm.run()
As a real-world example, here is some Lua code I'm using in a hobby game project: DEFINE(Traits.Position)[[
float x;
float y;
float z;
]]
DEFINE(Traits.Movement)[[
float x;
float y;
float z;
]]
DEFINE(Behaviors.do_movement){
input={Traits.Position, Traits.Movement},
output=Traits.Position,
frequency=0.01,
-- Update entities position
fn = function (pos, mov)
local delta = dark.timedelta
new_pos = Traits.Position.new()
new_pos.x = pos.x + (mov.x * delta)
new_pos.y = pos.y + (mov.y * delta)
new_pos.z = pos.z + (mov.z * delta)
return new_pos
end}
-- Create a sample entity
local entity = Entities.new()
entity.add(Traits.Position, {1.0, 0.0, 0.0})
entity.add(Traits.Movement, {0.0, -1.0, 0.0})
"That said, I'd give a higher priority for the language in my browser to be safe: some kind of correctness guarantee would be nice. Or even, while we're at it, some kind of way to analyze the script and say "this script GETS from urls x,y, and posts data d to z""I definitely agree with the above.
Re: Boot a linux kernel right inside your browser.
#245Re: Boot a linux kernel right inside your browser.
#246Earlier quoted context omitted.
Close but I think you have your orders understated. A normal programmer faces O(n^2), while a great programmer achieves O(n log n). Really bad programmers do O(k ^n) amount of work to achieve the same, with k>2.
Why k > 2? k > 1 is bad enough. Otherwise, recursive fib(n) would be just fine (O(~1.618^n)).
Re: Boot a linux kernel right inside your browser.
#247Re: Boot a linux kernel right inside your browser.
#248Re: Boot a linux kernel right inside your browser.
#249Also this new code is not released under a free license, so by default as far he is not sure what he's going to do with the code the "open source way" is not the default. This is not a critique. I think Fabrice Bellard is a genius, but as an observer he seems interested in making a profit from his work like many other programmers.
Instead subjectively I've to admit today I no longer consider the GPL a completely free license, but this is another matter and may be related not to earning but to the meaning "free software" has for you. For me it is as simple as letting people to do everything with your code. IMHO the BSD license turns out to be better both for users AND for you to earn from your product later.
Re: Boot a linux kernel right inside your browser.
#250I admire Fabrice a lot, he is a programming hero for me. However it is not true that he is not interested in money, for instance the QEMU module performing the run-time code translation to go fast was not released for free in order to earn from this. I don't know if he managed to earn or not from QEMU in the end, but IMHO that of selling the module to final user was not the right strategy, when QEMU was started and b…