Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ToxicFrog
Apr 26, 2008


Dr. Stab posted:

I wonder if you could build an OS in Inform 7.

pre:
> LOOK

The filesystem stretches away in all directions.

> X DEV

A directory full of device nodes. You aren't close enough to make out any details.

> GO DEV

The device nodes surround you. kmem looks particularly tasty.

> TAKE KMEM

Unexpected trap in kernel mode
Dumping memory

Would you like to RESTART the system, RESTORE an earlier state, UNDO your last action, or SHUTDOWN?

Adbot
ADBOT LOVES YOU

kitten smoothie
Dec 29, 2001


And with this we've reached Peak Hacker News-Compliant Technology Stack.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

kitten smoothie posted:

And with this we've reached Peak Hacker News-Compliant Technology Stack.
Their wiki is something else.

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

SupSuper posted:

Their wiki is something else.

When all you have is a hammer, you implement an operating system in server-side javascript.

comedyblissoption
Mar 15, 2006

http://www.w3.org/People/Bos/CSS-variables

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Symbolic Assignment Considered Harmful
--programmers, 2014

Steve French
Sep 8, 2003

SupSuper posted:

Their wiki is something else.

quote:

HTTP is secure. If you think otherwise, you should stop using the web. HTTP security can be poorly implemented however. We actually punt on handling security in asgard.

comedyblissoption
Mar 15, 2006

A lot of the horrors in CSS make a lot more sense now given this context of the people in control of CSS having horrible opinions.

Contra Duck
Nov 4, 2004

#1 DAD

pliable posted:

This is my favorite if-else block in the entire world. I'm a pretty lovely programmer but man, I've at least never done poo poo like that.

I mean, how does one not even see that the whole block will literally do the same exact thing?

At least they managed to chain together their if/else in a normal way, unlike the example I ran into today at work...

code:
        if (a.getSomething() == null)
        {
            a.setSomeValue(false);
        }
        else
        {
            if (a.getSomething() == null)
            {
                a.setSomeValue(false);
            }
            else
            {
                /* do some other stuff */
            }
        }
The first condition was originally different but was changed in some shoddy refactoring. It then didn't get picked up in review, and of course screwing with the conditions here produced a really subtle but nasty bug.

QuarkJets
Sep 8, 2008

Hypothetically, a.getSomething() could modify some data that results in the next a.getSomething() returning something different. For instance, if it was iterating over some data, then you'd definitely expect the second call of a.getSomething() to return something new

That code is still poo poo anyway, and it's probably not what's happening

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Paul MaudDib posted:

Symbolic Assignment Considered Harmful
--programmers, 2014

2008, but still, this wasn't true even back then:

Bert Bos posted:

CSS style sheets are short. They are not much bigger than one editor window. Very few people (only professional designers, it seems) write style sheets longer than a hundred lines.

Happily, I don't recall Bert really being very influential in practical terms about that stuff.

While we're in the CSS way back machine: http://www.w3.org/Submission/1996/1/WD-jsss-960822

canis minor
May 4, 2011

quote:

The distribution is as you might expect, lots of very small files, very few large files:
Half the files is less then 7 lines.
90% is less than 163 lines.
Only 0.6% is longer than 500 lines.

It struck me as hilarious that I've seen a CSS rule spanning over 500 lines. Then I continued on drinking.

Contra Duck
Nov 4, 2004

#1 DAD

QuarkJets posted:

Hypothetically, a.getSomething() could modify some data that results in the next a.getSomething() returning something different. For instance, if it was iterating over some data, then you'd definitely expect the second call of a.getSomething() to return something new

That code is still poo poo anyway, and it's probably not what's happening

I checked that myself when I saw it but no it was just a standard Java accessor :(

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.
It's fitting that an essay about CSS is a complete eyesore.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

ExcessBLarg! posted:

Fortunately there's a self-selection thing going on here. The folks experienced and competent enough to implement an operating system will recognize that it makes no sense to reinvent the wheel and will just contribute to Chrome OS, Firefox OS, Open webOS or whatever. The only folks who think this effort is a good idea will derail themselves long before they can make any actual progress.

As a bonus, it keeps the trendy incompetents from noising up mailing lists of decent projects.

This sounds like such a great thought until you realize that PHP actually took off and is still awful.

streetlamp
May 7, 2007

Danny likes his party hat
He does not like his banana hat

eithedog posted:

It struck me as hilarious that I've seen a CSS rule spanning over 500 lines. Then I continued on drinking.

i need to see this piece of art

HFX
Nov 29, 2004

Volmarias posted:

This sounds like such a great thought until you realize that PHP actually took off and is still awful.

php took off because it replaces what people were doing with Perl CGI and didn't require the heaviness of the javaee stack on linux. Why it continues to live on though, is because people like to keep bad ideas for ever.

NFX
Jun 2, 2008

Fun Shoe
edit: ^^ One of us needs to get an avatar.

quote:

The distribution is as you might expect, lots of very small files, very few large files:
Half the files is less then 7 lines.
90% is less than 163 lines.
Only 0.6% is longer than 500 lines.

Grammar aside, counting lines seems like a really dumb way to estimate the size of content that is regularly minified.

qntm
Jun 17, 2009
I just think it's comical to use the W3C's own websites as indicative of how the web generally works. That entire boxout is hysterical.

quote:

A bit of statistics on the W3C site reveals the following distribution of sizes of style sheets:

  • number of CSS style sheets: 25725
  • number of non-empty style sheets: 24805
  • largest style sheet: 4872 lines (generated by an early version of FrameMaker)
  • largest hand-written style sheet: 1462 lines (bought from a Web design company)
  • average non-empty style sheet: 54 lines

The distribution is as you might expect, lots of very small files, very few large files:

  • Half the files is less then 7 lines.
  • 90% is less than 163 lines.
  • Only 0.6% is longer than 500 lines.

Because what would a professional designer be doing on the web??

NFX posted:

Grammar aside, counting lines seems like a really dumb way to estimate the size of content that is regularly minified.

W3C obviously doesn't minify their stylesheets because they're trivially small already. In any case the author's whole argument - stylesheets are generally small enough that they don't need variables - seems to come from the perspective of someone working inside the original CSS rather than the minified.

Steve French
Sep 8, 2003

NFX posted:

edit: ^^ One of us needs to get an avatar.


Grammar aside, counting lines seems like a really dumb way to estimate the size of content that is regularly minified.

Counting lines is a poor measure of many things for many reasons, but in this case it has absolutely nothing to do with whether or not the content will be minified.

Who cares that this C function is 1000 lines long? It's going to end up being compiled...

PrBacterio
Jul 19, 2000

Soricidus posted:

I am shocked, shocked, to discover that the guy who thinks it would be a good idea to base an OS on Javascript is not a highly-skilled engineer.
You know, I'm trying over here but I frankly can't think of a reason why, in principle, an OS built on Javascript would have to be a bad idea on the face of it. I mean, obviously the way they're doing it is poo poo but I can't seem to figure out why JS would necessarily make for a worse foundation for a general-purpose end-user OS than, say, Java, C# or bash. There doesn't seem to be any reason why building an entire userland on top of a performant Javascript VM couldn't work in the same way that, say, Java does for Android :shrug:

FlapYoJacks
Feb 12, 2009

PrBacterio posted:

You know, I'm trying over here but I frankly can't think of a reason why, in principle, an OS built on Javascript would have to be a bad idea on the face of it. I mean, obviously the way they're doing it is poo poo but I can't seem to figure out why JS would necessarily make for a worse foundation for a general-purpose end-user OS than, say, Java, C# or bash. There doesn't seem to be any reason why building an entire userland on top of a performant Javascript VM couldn't work in the same way that, say, Java does for Android :shrug:

Android is pretty much 100% built from C/C++, at least the base of it is.

apseudonym
Feb 25, 2011

ratbert90 posted:

Android is pretty much 100% built from C/C++, at least the base of it is.

The framework is in Java so that's a bit of a stretch...

FlapYoJacks
Feb 12, 2009

apseudonym posted:

The framework is in Java so that's a bit of a stretch...

Init/Vold/all the multimedia capabilities/all logging/DALVIK(or ART)/all the networking fundamentals/hardware hal drivers.

Hell, just go into ./system and type in find . -name *.cpp or find . -name *.c

As somebody who's been working with the Android source for quite a while, no, that isn't a stretch by any means of the imagination.

apseudonym
Feb 25, 2011

ratbert90 posted:

Init/Vold/all the multimedia capabilities/all logging/DALVIK(or ART)/all the networking fundamentals/hardware hal drivers.

Hell, just go into ./system and type in find . -name *.cpp or find . -name *.c

As somebody who's been working with the Android source for quite a while, no, that isn't a stretch by any means of the imagination.

I have a bunch commits in system and bionic, I know. Calling it "pretty much 100% build from" when the framework is Java is silly though. Unless you dont count that as the base level, in which case yes, pretty much 100% C/C++.

FlapYoJacks
Feb 12, 2009

apseudonym posted:

I have a bunch commits in system and bionic, I know. Calling it "pretty much 100% build from" when the framework is Java is silly though. Unless you dont count that as the base level, in which case yes, pretty much 100% C/C++.

That's what I meant? :confused:

Android is fine, but the base is C/C++, which is understandable. Making a OS completely out of Java would probably be terrible.

(Mainly because it would be Java.) :v:

apseudonym
Feb 25, 2011

ratbert90 posted:

That's what I meant? :confused:

Android is fine, but the base is C/C++, which is understandable. Making a OS completely out of Java would probably be terrible.

(Mainly because it would be Java.) :v:

Then ignore me being dumb, it is early.

Didn't MSR make a kernel in C# a few years back? Whatever happened to that?

FlapYoJacks
Feb 12, 2009

apseudonym posted:

Then ignore me being dumb, it is early.

Didn't MSR make a kernel in C# a few years back? Whatever happened to that?

How the gently caress do you make a kernel without the ability to have function pointers? :stare:

*Edit*

On a unrelated note:

Freescale hosed up their TRM and as a result this was put into their IOMUX Macro list for Uart4 which is bad, because it's wrong and breaks UART4.

code:
#define _MX6Q_PAD_CSI0_DAT17__UART4_CTS IOMUX_PAD(0x066C, 0x029C, 3, 0x0934, 1, 0)
This particuarly nasty bug came to light when the client wanted bluetooth to work, and while I could manually printf stuff out to the serial line, and the scope showed what I was echoing out perfectly, the driver to enable bluetooth wouldn't work.

Why? Because the processor would never give the CTS signal properly on that line and thus any requests for chip information would never get sent back to the firmware loader.

The appropriate code is this btw:

code:
#define _MX6Q_PAD_CSI0_DAT17__UART4_CTS IOMUX_PAD(0x066C, 0x029C, 3, 0, 0, 0)
Thanks Freescale! This is the second time a TRM has been incorrect in my years of doing firmware coding! :argh:

FlapYoJacks fucked around with this message at 17:22 on Sep 12, 2014

apseudonym
Feb 25, 2011

ratbert90 posted:

How the gently caress do you make a kernel without the ability to have function pointers? :stare:

http://research.microsoft.com/en-us/projects/singularity/

The kernel was written in Sing# which is an extension of C#, so not exactly in C#.

omeg
Sep 3, 2012

ratbert90 posted:

How the gently caress do you make a kernel without the ability to have function pointers? :stare:

C# has pointers.

PrBacterio
Jul 19, 2000

ratbert90 posted:

Init/Vold/all the multimedia capabilities/all logging/DALVIK(or ART)/all the networking fundamentals/hardware hal drivers.

Hell, just go into ./system and type in find . -name *.cpp or find . -name *.c

As somebody who's been working with the Android source for quite a while, no, that isn't a stretch by any means of the imagination.
Right, just like the Kernel in that NodeOS thing, which is Linux, is obviously all of a sudden not written in C anymore but in Javascript. The discussion was about an OS with a userland written in Javascript, in the same way like Android's is written in Java. That the kernel, drivers and support would, in either case, still be written in a systems programming language (which, these days, pretty much means C/C++) and at any rate probably just be based on the Linux kernel anyway was not even in question so I don't see why you'd even bring it up. I thought it was pretty obvious what I meant but I guess nitpickers gonna nitpick.

ExcessBLarg!
Sep 1, 2001

PrBacterio posted:

You know, I'm trying over here but I frankly can't think of a reason why, in principle, an OS built on Javascript would have to be a bad idea on the face of it.
In some ways it's not, but the approach is wrong. Both Chrome and Firefox have effectively evolved into their own applications platform, especially the former with the Chrome Web Store. If you strip away everything but the browser, you have Chrome OS and Firefox OS. Both have a solid technical basis for moving in that direction too; the browser provides sandboxing and a security model that's a significant improvement over legacy desktop platforms. Much like iOS and Android apps, you can install Chrome apps that run offline/locally and all that good stuff, without fear that it will delete your files and fuckup your computer.

But both Chrome and Firefox OS don't try to completely replace userland components with JavaScript equivalents, especially the ones that users don't interact with directly. Instead, they build on a solid base of vetted opensource code. That's the part that Node OS is trying to replace, and there's no real technical advantage in doing it. It's a complete waste of time.

ExcessBLarg!
Sep 1, 2001

PrBacterio posted:

The discussion was about an OS with a userland written in Javascript, in the same way like Android's is written in Java.
One difference is that the components that Node OS is currently trying to replace are equivalent to the C/C++ Android code borrowed from BSD and other sources. Literally everything in Android that's actually written in Java and runs on Dalvik/ART is marked TODO in Node OS, with the foggiest idea of how to actually get there.

apseudonym
Feb 25, 2011

ExcessBLarg! posted:

One difference is that the components that Node OS is currently trying to replace are equivalent to the C/C++ Android code borrowed from BSD and other sources. Literally everything in Android that's actually written in Java and runs on Dalvik/ART is marked TODO in Node OS, with the foggiest idea of how to actually get there.

Now that is a horror

FlapYoJacks
Feb 12, 2009

omeg posted:

C# has pointers.

Function pointers, not regular pointers. :colbert:


Edit*

Aren't function pointers called delegates or something in C# and have to be marked as unsafe? It's been so long since I had the pleasure of using that language.

Sedro
Dec 31, 2008
Delegates are just functions-as-values.

C# does have C-style pointers in unsafe code, which is rarely used.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

ratbert90 posted:

How the gently caress do you make a kernel without the ability to have function pointers? :stare:

Beaten like a stepchild, but C# has pointers. You use unsafe{} blocks and you can C-it up like it's 1990, fixed{} even pins objects so the GC won't move them. Delegates are type-safe function pointers.

Singularity was the project and what follows is from memory so don't take it at face value: the boot loader was a small bit of assembly, followed by a very small C program to setup the basic environment and kick off the kernel, then the kernel was almost 100% C# code, of which the vast majority was safe with only a few critical parts implemented in unsafe blocks like interrupt handling routines.

They created Sing# because they implemented asynchronous message passing and waiting in the kernel and JIT compiler and completely did away with the ring0/ring3 distinction. All code was kernel mode code, but the kernel would examine the MSIL and refuse to load any modules that were sketchy so you could be 100% certain that there were zero buffer overflows, zero stack smashing attacks, etc in the entire system, from drivers to web servers. Processes could specify the memory strategy they wanted, from different GC implementations to reference counting, or even manual memory management.

It used the microkernel model of separate components so you can isolate failure and in theory restart a failed component, but they solved the slowness/overhead problem... messages could only be owned by one process at a time and when you sent a message, the kernel enforced that you could no longer access it, nor even take a pointer to it. Because message passing didn't require ring transitions, the performance was even faster than a syscall. I don't think they got around to having a single address space mode on 64-bit, but that seemed like a logical option to avoid TLB thrashing as well.


As far as I know it lies in the MS Research death dumpster for the same reason most attempts at creating a new OS fail: everyone already has an OS that mostly works so there's no push to adopt anything better, heartbleed, code red, slammer, [insert hundreds of thousands of other exploits, worms viruses, crappy drivers, memory corruption bugs, et al] notwithstanding.

1337JiveTurkey
Feb 17, 2005

Ender.uNF posted:

As far as I know it lies in the MS Research death dumpster for the same reason most attempts at creating a new OS fail: everyone already has an OS that mostly works so there's no push to adopt anything better, heartbleed, code red, slammer, [insert hundreds of thousands of other exploits, worms viruses, crappy drivers, memory corruption bugs, et al] notwithstanding.

I thought that it was incorporated into a follow-on project called Midori which is being actively developed with an eye towards use as a cloud computing platform.

Vanadium
Jan 8, 2005

Delegates are more like a set of functions than a single one :q:

Adbot
ADBOT LOVES YOU

ExcessBLarg!
Sep 1, 2001

Ender.uNF posted:

As far as I know it lies in the MS Research death dumpster for the same reason most attempts at creating a new OS fail: everyone already has an OS that mostly works so there's no push to adopt anything better,
There's also the problem where the world runs on a shitload of legacy software. Can you run a legacy C library in this environment? If so, does it still protect you against all the traditional C-language vulnerabilities for which we've spent decades hardening traditional kernels? If either answer is no, yeah, you're not going to get wide adoption.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply