News for hackers. Stuff that matters.
Re:Python without an operating system by amyjess on Tuesday April 28, 2015 @05:17PM (#9455222)
Next step: Python as an operating system. Like Chrome OS or Firefox OS, just with Python instead of a web engine. I'm a big enough Python fan that the idea really intrigues me.

(also, everytime I see an LWN article here, I keep meaning to subscribe, but I mostly read HN at work, and I usually forget by the time I get home... I feel really bad about that)

Re:Python without an operating system by JoshTriplett on Wednesday April 29, 2015 @01:08AM (#9456575)
> (also, everytime I see an LWN article here, I keep meaning to subscribe, but I mostly read HN at work, and I usually forget by the time I get home... I feel really bad about that)

If you work anywhere even remotely related to Open Source, I'd recommend getting your employer to get a corporate subscription. It's one of the single most valuable news sources I read; it summarizes LKML and numerous other first-hand sources, as well as many conferences, summits, and other in-person events.

Re:Python without an operating system by striking on Tuesday April 28, 2015 @06:39PM (#9455521)
Lisp Machines, except in 2015. The beautiful phoenix returns.
Re:Python without an operating system by fzzzy on Tuesday April 28, 2015 @07:04PM (#9455639)
Re:Python without an operating system by voltagex_ on Tuesday April 28, 2015 @08:41PM (#9455940)
Anyone want to take a stab at running it in QEMU?

http://uuu.cvs.sourceforge.net/viewvc/uuu/

Edit: http://dl.sourceforge.net/project/uuu/Existence/2003-09-21/e... should boot with qemu-system-i386

Re:Python without an operating system by Macha on Tuesday April 28, 2015 @06:16PM (#9455437)
That would be interesting. This isn't quite freestanding Python, in that it's running on Grub so there is a lower layer, but it's still cool despite that.
Re:Python without an operating system by amyjess on Tuesday April 28, 2015 @06:48PM (#9455569)
Well, even Chrome OS and Firefox OS don't have their own kernels; they run on top of Linux.

If you were to build a Python OS, you'd probably start by writing PID 1 in Python. It would be a Python init, starting services written in Python, running gettys written in Python, and you'd log into a shell written in Python.

Hmm... I can actually see myself writing an init system in Python... (hell, I did exactly that at my last company.... I'd have to rewrite it from scratch, but that's no big deal...)

Great, I think I've found a new rabbit hole.

Re:Python without an operating system by e12e on Wednesday April 29, 2015 @02:18PM (#9460480)
I wonder how much tweaking supervisord[1] would need to be suitable as a init replacement/for running as PID 1?

Incidentally, I also came across [2] -- which I wasn't aware of.

[1] http://supervisord.org/

[2] https://www.python.org/dev/peps/pep-3143/ https://pypi.python.org/pypi/python-daemon

Re:Python without an operating system by voltagex_ on Tuesday April 28, 2015 @07:51PM (#9455803)
Message me if you start this!
Re:Python without an operating system by pygy_ on Wednesday April 29, 2015 @02:49AM (#9456786)
https://github.com/justincormack/ljsyscall is just that, but for Lua.

FFI to the kernel on Linux, NetBSD Rump kernels and even bare on Xen.

Re:Python without an operating system by jacquesm on Wednesday April 29, 2015 @06:24AM (#9457324)
Every OS ever had a bootloader of some sort as far as I'm aware, in some cases you had to toggle them in through the front panel but I don't know of any OS that did not have a bootstrapping stage prepended.
Re:Python without an operating system by Macha on Wednesday April 29, 2015 @07:12AM (#9457464)
The bootloader normally hands over the OS once it starts however, it doesn't continue running and acting as an interface to the hardware.
Re:Python without an operating system by jacquesm on Wednesday April 29, 2015 @08:57AM (#9457914)
There's the bootloader, there's the bios and there is the operating system. It's perfectly legal to do bios calls from a running operating system (though there will be a price to pay for sure). The bootloader is usually discarded after the boot. The bios doesn't 'run' in any way either until you call it, think of it as a library that you can call.
Re:Python without an operating system by pjc50 on Wednesday April 29, 2015 @05:13AM (#9457143)
Really would have to do something about the GIL in that case unless you want to be restricted to one core - or run several independent interpreters NUMA-style.
Re:Python without an operating system by JoshTriplett on Wednesday April 29, 2015 @11:23AM (#9458927)
Yeah, the GIL is the biggest reason we haven't tried to run any Python code on non-boot CPUs; we just run tiny C functions that return information to the boot CPU.
Re:Python without an operating system by mahouse on Wednesday April 29, 2015 @07:08AM (#9457453)
Or a web engine made in Python.

https://en.wikipedia.org/wiki/HotJava

Re:Python without an operating system by mixmastamyk on Tuesday April 28, 2015 @06:26PM (#9455470)
> I usually forget by the time I get home

Send yourself email reminders.

Re:Python without an operating system by seanp2k2 on Tuesday April 28, 2015 @10:05PM (#9456148)
I really like Wunderlist. In the past few months, they seem to have fixed their syncing issues, so mobile and desktop are pretty seamless now. I keep tons of ideas in Wunderlist, and the search works pretty well if I just brain-dump some keywords into the todo item.

I also made a thing to suck all the Github repos you star into Wunderlist with their descriptions, since I always want to find something I starred in the past, and I've found Github's search lacking in this regard: https://github.com/ip2k/wunder-star

Re:Python without an operating system by e12e on Wednesday April 29, 2015 @02:31PM (#9460595)
Or just use "at"[1] and "mail" (assuming you have access to a computer that is connected and on after you leave for work):

    $ at 8pm <<END
    > echo "Don't forget to subscribe to lwn!" \
    >   | mail -s "LWN reminder" [email protected]
    > END
[1] http://debian-handbook.info/browse/stable/sect.task-scheduli...
Re:Python without an operating system by friendzis on Wednesday April 29, 2015 @02:41AM (#9456759)
Next step: Python on bare metal ARM targets. Imagine loading Python interpreter to an uC, quickly hacking together some scripts and happily running some DIY project. `sys` and especially `os` packages are out, maybe some high level features and something clever has to be done about interrupts, but that would be totally awesome
Re:Python without an operating system by ul5255 on Wednesday April 29, 2015 @02:44AM (#9456769)
That is already available: https://micropython.org I have the PyBoard but one can get it running on ST Discovery boards as well.