POV-Ray : Newsgroups : povray.off-topic : Web frameworks Server Time
29 Jul 2024 16:27:03 EDT (-0400)
  Web frameworks (Message 8 to 17 of 27)  
<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Francois Labreque
Subject: Re: Web frameworks
Date: 18 Nov 2011 09:02:41
Message: <4ec66581$1@news.povray.org>
Le 2011-11-18 04:43, Invisible a écrit :
> On 18/11/2011 04:07 AM, Darren New wrote:
>> On 11/17/2011 6:21, Invisible wrote:
>>> Erlang has Wings 3D.
>>
>> Errr, no. Erlang has the north american telephone switching system. :-)
>
> Well, yeah, and Haskell has defence contractors, investment bankers,
> cryptographers and IC designers using it. AND NOBODY GIVES A DAMN. :-P
>

Aren't defense contractors all using ADA?  Or did that change over the 
last 10 years?


-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Invisible
Subject: Re: Web frameworks
Date: 18 Nov 2011 09:18:17
Message: <4ec66929$1@news.povray.org>
>>>> Erlang has Wings 3D.
>>>
>>> Errr, no. Erlang has the north american telephone switching system. :-)
>>
>> Well, yeah, and Haskell has defence contractors, investment bankers,
>> cryptographers and IC designers using it. AND NOBODY GIVES A DAMN. :-P
>>
>
> Aren't defense contractors all using ADA? Or did that change over the
> last 10 years?

"All" might be an exaggeration. But you're right, there's probably more 
of them using Ada than there are using Haskell...


Post a reply to this message

From: Invisible
Subject: Re: Web framework costs
Date: 18 Nov 2011 10:56:18
Message: <4ec68022$1@news.povray.org>
On 17/11/2011 02:21 PM, Invisible wrote:

> I started with the implausibly-named (and unpronounceable) "Yesod"
> framework.

The good part: It's very easy to install. Assuming you already have 
Haskell installed, it takes one command to download and compile all the 
source code. And it even works on Windows.

The bad part, arguably, is that it downloads, compiles and installs 85 
individual Haskell packages. Which, obviously, takes a little while. (!) 
And then, when you run the scaffolder to build a skeleton site and try 
to run it, it downloads and installs even *more* packages! By the end of 
it, using the Sqlite DB, I had 97 packages installed. If you want to use 
more backends, obviously you end up with even more packages.

Also interesting: The scaffolder executable is 7MB in size. An empty 
site using the "tiny" scaffold is 22MB, and one using the "sqlite" 
scaffold is 34MB. This for a site that serves one single HTML page. 
(Static linking FTW!)

[You would have thought, given that they went to all the bother of 
providing a scaffolder tool, they could make it produce a really 
good-looking default site. But no; it looks like 1993 in there.]

> Having digested all of that, I went and took a look at Happstack

By contrast, Happstack consists of 16 packages. There is no handy 
scaffolder, but a simple "hello world" application is 3 lines of code. 
Compiling it, I get a 10MB application, which delivers a single piece of 
text. (Not HTML, just text.)


Post a reply to this message

From: Darren New
Subject: Re: Web frameworks
Date: 19 Nov 2011 01:30:57
Message: <4ec74d21@news.povray.org>
On 11/18/2011 1:43, Invisible wrote:
> Well, yeah, and Haskell has defence contractors, investment bankers,
> cryptographers and IC designers using it. AND NOBODY GIVES A DAMN. :-P

Sure. But average people don't see that. It's easy to point to the phone 
system and say "See? Doesn't crash." :-)

> And hence, I thought you might be interested to see how a couple of tools
> approach [or ignore] the problem. I know I was...

Indeed I was. Thanks for that.

> On the plus side, this is Haskell. Sometimes the type signature is enough to
> actually tell you WHAT THE CODE DOES. That's a pretty amazing property,
> which few other languages have.

Actually, I think perhaps Hermes does even better, in some senses, because 
it has typestate. So you can say things like "This returns a record where 
either the array of results has more than one entry and the error code 
hasn't been assigned, or the error code has been assigned and the rest of 
the results have not."  Maybe you can do that with the Maybe bit of Haskell 
or something, tho.

> On the other hand, sometimes the type signature DOES NOT tell you what the
> code does. And then not having any *real* documentation utterly sucks.

That's always the problem yes.

> Also, Haskellers have this bizarre perversion where some people think that
> describing the axioms that a structure satisfies as the same thing as
> explaining WHAT IT DOES, WHY THAT'S USEFUL or HOW YOU USE IT. :-P

Not uncommon. I prefer both, myself. Lazy vague prose doesn't work as 
documentation either.

>> This is how most systems that compile templates work, including Java and
>> ASP.NET.
>
> I've never heard of a system which actually /compiles/ templates.

Any template system written in a compiled language, like ASP.NET.

Heck, GWT takes Java code and compiles the half that runs on the browser 
into optimized javascript.

> I'm not seeing how type erasure is in any way related to the ability or
> inability to dynamically load new code.

If you don't know what types are in the code you're loading, how do you load it?

>> And ASP.NET even notices
>> the executable changed and reloads it (or notices the source changed and
>> recompiles it and reloads it), letting existing transactions finish and
>> new transactions power up the new code.
>
> Well, yeah, the Yesod scaffolder sets things up so that if you change any
> code, and then restart the server, it recompiles anything first.

Right. I'm saying ASP.NET does the Erlang thing, where it lets existing 
transactions finish with the old code while new transaction (i.e., hits) 
gets the new code. You don't have to restart anything, lose any session 
state, close any database connections, etc.

I'm not sure it works if you assume a new database schema, mind.

I'm sure both systems have their plusses and minuses. Don't read this as 
"Ha, ASP.NET is better!"  I'm just pointing out that much of what you're 
talking about isn't conceptually new, so don't embarrass yourself by talking 
about this cool new Haskell stuff with an ASP.NET programmer. :-)

>> Very convenient for deployment, you must exist. If you're writing an
>> application (like, a wiki manager say), distributing it this way is an
>> excellent way of doing it.
>
> "You must exist"? What, I post, therefore I am? ;-)

You must admit, is what I meant to type.

> But yeah, it's probably quite nice for final deployment. I'm unsure what
> it's like for development.

Depends how fast it restarts. At least it isn't GWT, which takes 5 minutes 
to recompile a simple page even given 1000 machines to compile on. :-)

>>> It also means that any time anything in any template changes, that
>>> template
>>> must be recompiled, and then the entire program relinked. And then you
>>> have
>>> to shut down the running server and fire up the newly compiled on.
>>
>> Generally not a problem, really.
>
> Well, assuming you're not hacking up changes on your production box. (Why
> would you *ever* do that?)

If you can't afford downtime, but you only have one server, you're screwed 
more than your development environment will ever screw you.

>>> All of which seems... a bit strange, to me. Then again, if you want to
>>> use
>>> Apache, you can build your application for Fast-CGI instead. Then only
>>> the
>>> application logic and presentation templates get linked into a giant
>>> binary
>>> blob, and you don't have to restart the entire server to update. It still
>>> seems like a rather heavyweight approach.
>>
>> If you need better than that, you're probably doing it wrong anyway. Or
>> you should be using something like Erlang instead.
>
> I'm not sure I follow.

If restarting the server is a problem, and you don't have a second server 
capable of taking care of the load while the first one restarts, then you're 
utterly screwed the instant the power goes out, the hard drive dies, or the 
power supply makes your RAM act flakey.

If "you have to restart the entire server to update" is a problem, then 
you're screwed. You either have few enough customers that a few seconds of 
down-time isn't a problem, or you're out of business at the first hardware 
failure.

>>> worst thing that can happen is that you say UserProfile 138, and there
>>> *isn't* a user number 138 at the moment.
>>
>> Or the user dicks with the URL and bypasses something in your code you
>> thought would be enforced.
>
> No, that's kind of the point. Each URL is checked against the list of valid
> URL structures. If it matches one, it gets passed off to that chunk of code.
> If it matches none, it's 404. (That includes checking that, say, the user ID
> *is* a valid number, and *isn't* negative, and so forth.)

As long as you can check everything the type system agrees to enforce 
(which, thinking on it, I guess you can), then sure. As long as the user 
doesn't change the user ID to the number of some other user, or a deleted 
user, or something like that, or you can catch such a thing. I.e., it's not 
a panacea.

> What it does mean is that you can take a string, insert it into a small HTML
> template, insert the small HTML template into a larger HTML template, and
> bolt on some other templates. The original string gets escaped before
> insertion. The HTML does /not/ get escaped when inserted into the rest. And
> so forth. All of which you /could/ keep track of manually, but it would be
> really easy to get it wrong...

Yep. That's what a good powerful type system can do for you that even 
"strongly" typed machine-level (vs application-level) typing can't do.

> Yesod claims to be "RESTful". I have literally no idea WTF that actually
> means. (As best as I can tell, it's a philosophy, not something more concrete.)

Kind of, yes. REST means "Representative State" or something like that. 
Basically, a URL refers to some "object" or "document", and the links to 
other objects are embedded as URLs inside that document. I.e., the way HTML 
and HTTP works. Rather than the way (for example) RPC works.

> Of course, desktop interfaces have always worked like this. It's news to me
> that anyone has ever successfully implemented this for a web interface,
> however.

It's pretty frighteningly gruesome.

>>> Again, I'm unconvinced of how well
>>> it really works, but I admire the idea.
>>
>> Given that pretty much everyone in the world does it this way, yah, it
>> seems it's an idea that's here to stay. :-)
>
> Again, I've never seen it done on the web.

It's relatively recent stuff, and it takes an entire complex IDE cooperating 
with the software stack to make it usable. But yah, it's common at the 
"enterprise" level.

> 1. Every system I've seen makes it unnecessarily hard to use cookies.
> 2. I haven't seen a system which actually applies cryptography to the problem.

Yeah. Old stuff was like that. Newer stuff makes it easier. Just sayin'. :-) 
Glad you're getting into it now, and I feel sorry for you if you ever *have* 
to get into it. Because it means you've been sucked into the "web-app" 
world, which is by far the kludgyest environment ever invented.

> ...which is why this is an interesting point to discuss.

Yep. Just making sure you realize that *was* what I meant, and now you're 
experiencing it first-hand, as it were.

> This is precisely my point, and it seems to be lost on most people.

Agreed.

> If you want to store just the data your application uses, go ahead. Knock
> yourself out. You can just dump it all into a flat file. That works, right?
> And you can structure that file in whatever way is most efficient for your
> particular application.

That's what bugs me about all the folks that insist the flat files that UNIX 
offer are the only thing you'll ever need, because everything else can be a 
library. Because they never actually used a system that offered more and 
realized that the universality of it was useful.

> And yet, everybody seems to think that a database is just a flat file, but
> better...

Only *most* people. :-)

> I'm definitely not Google. o_O

I mean, everyone writing code thinks they are going to be able to overwhelm 
a 96-processor 16TB RAM SQL server machine with their app, to the point 
where they need nosql storage for ACID data.

> It did amuse me how Yesod says that "by being non-relational, we gain more
> flexibility and the ability to avoid the overhead of table joins". Well, you
> know what? Table joins have overhead in time. But denormalised data has
> overhead in space. And redundancy. And you know what else? Every half-sane
> RDBMS optimises the **** out of table joins. You can even cache the result
> on disk if you want. And you know what? Then you have denormalised data,
> without any of the runtime overhead, but the database MANAGES THE REDUNDANCY
> FOR YOU! Whereas the alternative is to store all your data denormalised, and
> manage the redundancy yourself, manually. Oh, I hope you don't make a
> mistake. Because, let's face it, there's lots of opportunities to get it
> wrong...

Yep. *And* you're actually doing the joins. You're just doing it manually, 
so you're not really avoiding any overhead. If you need the result of a 
join, you're doing the join when you store instead of when you fetch.

The only time nosql really works is when you have data that you can shard 
very specifically. When you have one user's emailbox for example, and you 
can deal with that ACIDly, and not worry about the other users. Stuff like 
accounting? Nope.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Francois Labreque
Subject: Re: Web frameworks
Date: 19 Nov 2011 08:43:10
Message: <4ec7b26e$1@news.povray.org>
Le 2011-11-18 09:18, Invisible a écrit :
>>>>> Erlang has Wings 3D.
>>>>
>>>> Errr, no. Erlang has the north american telephone switching system. :-)
>>>
>>> Well, yeah, and Haskell has defence contractors, investment bankers,
>>> cryptographers and IC designers using it. AND NOBODY GIVES A DAMN. :-P
>>>
>>
>> Aren't defense contractors all using ADA? Or did that change over the
>> last 10 years?
>
> "All" might be an exaggeration. But you're right, there's probably more
> of them using Ada than there are using Haskell...

It used to be a requirement for US DoD contractors, and since most NATO 
countries shop at the same places, everyone was using ADA.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Orchid XP v8
Subject: Re: Web frameworks
Date: 19 Nov 2011 11:58:41
Message: <4ec7e041$1@news.povray.org>
On 19/11/2011 06:30 AM, Darren New wrote:
> On 11/18/2011 1:43, Invisible wrote:
>> Well, yeah, and Haskell has defence contractors, investment bankers,
>> cryptographers and IC designers using it. AND NOBODY GIVES A DAMN. :-P
>
> Sure. But average people don't see that. It's easy to point to the phone
> system and say "See? Doesn't crash." :-)

Is it actually true that the /entire/ phone system is Erlang? I know 
Ericson use it, but is it really running *everything*?

>> And hence, I thought you might be interested to see how a couple of tools
>> approach [or ignore] the problem. I know I was...
>
> Indeed I was. Thanks for that.

NP.

>> On the plus side, this is Haskell. Sometimes the type signature is
>> enough to
>> actually tell you WHAT THE CODE DOES. That's a pretty amazing property,
>> which few other languages have.
>
> Actually, I think perhaps Hermes does even better, in some senses,
> because it has typestate. So you can say things like "This returns a
> record where either the array of results has more than one entry and the
> error code hasn't been assigned, or the error code has been assigned and
> the rest of the results have not." Maybe you can do that with the Maybe
> bit of Haskell or something, tho.

Well, it depends how far you want to go. There are people who have built 
things like a library that statically checks that your client and server 
speak an identical protocol, and there can never be a message mismatch. 
Trouble is, the type signatures became insane, and it gives the compiler 
a bit of a headache.

It's a question of degree, though. You already have the IO type, which 
means "this function might perform arbitrary input/output operations", 
the ST type which means "this function might use mutable state, but 
cannot communicate with the outside world or other running threads", and 
the STM type, which means "this function might use shared mutable 
variables, but cannot perform I/O". You can take this further, if you 
desire. Most people don't.

>> On the other hand, sometimes the type signature DOES NOT tell you what
>> the
>> code does. And then not having any *real* documentation utterly sucks.
>
> That's always the problem yes.

I should think that /any/ system is eventually going to come to a point 
where you need real documentation. There are those who say "the source 
*is* the documentation". But looking at Yesod, with almost 100 packages, 
I wouldn't want to have to read all that lot to try to /guess/ what the 
designer's intensions were. :-P

>> Also, Haskellers have this bizarre perversion where some people think
>> that
>> describing the axioms that a structure satisfies as the same thing as
>> explaining WHAT IT DOES, WHY THAT'S USEFUL or HOW YOU USE IT. :-P
>
> Not uncommon. I prefer both, myself. Lazy vague prose doesn't work as
> documentation either.

You could say

   "The fmap function must satisfy fmap id == id and fmap (f . g) == 
fmap f . fmap g". Or you can say "fmap applies a function to every 
element of a container without affecting the structure of the container 
itself". The latter tells you what the function is *for*.

>> I've never heard of a system which actually /compiles/ templates.
>
> Any template system written in a compiled language, like ASP.NET.

It's also news to me that ASP.NET is compiled. I thought it was just 
another scripting language.

> Heck, GWT takes Java code and compiles the half that runs on the browser
> into optimized javascript.

That's pretty hardcore, right there.

>> I'm not seeing how type erasure is in any way related to the ability or
>> inability to dynamically load new code.
>
> If you don't know what types are in the code you're loading, how do you
> load it?

Doesn't seem to stop C. :-P

>> Well, yeah, the Yesod scaffolder sets things up so that if you change any
>> code, and then restart the server, it recompiles anything first.
>
> Right. I'm saying ASP.NET does the Erlang thing, where it lets existing
> transactions finish with the old code while new transaction (i.e., hits)
> gets the new code. You don't have to restart anything, lose any session
> state, close any database connections, etc.

Well, yeah, being able to smoothly transition from one to the other is 
much nicer. I suppose you might perhaps be able to do that by having 
multiple physical servers and bouncing them one at a time? (I'm just 
trying to think of obvious ways that might go wrong...)

>> But yeah, it's probably quite nice for final deployment. I'm unsure what
>> it's like for development.
>
> Depends how fast it restarts. At least it isn't GWT, which takes 5
> minutes to recompile a simple page even given 1000 machines to compile
> on. :-)

Compiling is pretty instant. /Linking/ seems to take a while. (Then 
again, it's linking a 37MB binary...) I'll have to see what it runs like 
interpretted.

>> I'm not sure I follow.
>
> If "you have to restart the entire server to update" is a problem, then
> you're screwed. You either have few enough customers that a few seconds
> of down-time isn't a problem, or you're out of business at the first
> hardware failure.

Right, I see.

>>> Or the user dicks with the URL and bypasses something in your code you
>>> thought would be enforced.
>>
>> No, that's kind of the point. Each URL is checked against the list of
>> valid
>> URL structures. If it matches one, it gets passed off to that chunk of
>> code.
>> If it matches none, it's 404. (That includes checking that, say, the
>> user ID
>> *is* a valid number, and *isn't* negative, and so forth.)
>
> As long as you can check everything the type system agrees to enforce
> (which, thinking on it, I guess you can), then sure. As long as the user
> doesn't change the user ID to the number of some other user, or a
> deleted user, or something like that, or you can catch such a thing.
> I.e., it's not a panacea.

Sure. It removes one level of stuff that can go wrong. There's still 
plenty of other stuff that can break.

(I'm assuming here that you're only using a user ID in the URL to allow 
people to view somebody's public user profile. You should NOT be using 
this for actual authentication or anything like that...)

> Yep. That's what a good powerful type system can do for you that even
> "strongly" typed machine-level (vs application-level) typing can't do.

Indeed.

>> Of course, desktop interfaces have always worked like this. It's news
>> to me
>> that anyone has ever successfully implemented this for a web interface,
>> however.
>
> It's pretty frighteningly gruesome.

Required XKCD quote: http://www.xkcd.com/934/ [Esp. the alt. text.]

> Yeah. Old stuff was like that. Newer stuff makes it easier. Just sayin'.
> :-) Glad you're getting into it now, and I feel sorry for you if you
> ever *have* to get into it. Because it means you've been sucked into the
> "web-app" world, which is by far the kludgyest environment ever invented.

IMHO, the entire concept of trying to make an "application" using a 
document description language and a document access protocol is 
fundamentally flawed. But WTF do I know?

>> And yet, everybody seems to think that a database is just a flat file,
>> but better...
>
> Only *most* people. :-)

Perhaps I've spent too long on The Daily WTF.

I did see a guy on the Oracle forum once asking how to write a certain 
DB query. It seems their application was a Java thing that used the Java 
object serialisation thingy to turn its data into a binary blob to store 
in the DB. And the guy was asking how to do a query against this data. 
Oracle's answer being "you've been a very silly boy, haven't you?"

>> I'm definitely not Google. o_O
>
> I mean, everyone writing code thinks they are going to be able to
> overwhelm a 96-processor 16TB RAM SQL server machine with their app, to
> the point where they need nosql storage for ACID data.

I am *definitely* not one of those people. I doubt I'll ever write 
anything that actually gets hit by more than 2 users concurrently.

>> It did amuse me how Yesod says that "by being non-relational, we gain
>> more
>> flexibility and the ability to avoid the overhead of table joins".
>
> Yep. *And* you're actually doing the joins. You're just doing it
> manually, so you're not really avoiding any overhead. If you need the
> result of a join, you're doing the join when you store instead of when
> you fetch.

Quite.

> The only time nosql really works is when you have data that you can
> shard very specifically. When you have one user's emailbox for example,
> and you can deal with that ACIDly, and not worry about the other users.
> Stuff like accounting? Nope.

Dude, accountants *invented* the concept of "transactions"! :-D

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Web frameworks
Date: 19 Nov 2011 13:13:41
Message: <4ec7f1d5$1@news.povray.org>
On 11/19/2011 8:58, Orchid XP v8 wrote:
> Is it actually true that the /entire/ phone system is Erlang? I know Ericson
> use it, but is it really running *everything*?

I don't know. It runs the critical 100%-uptime infrastructure.

> I should think that /any/ system is eventually going to come to a point
> where you need real documentation. There are those who say "the source *is*
> the documentation". But looking at Yesod, with almost 100 packages, I
> wouldn't want to have to read all that lot to try to /guess/ what the
> designer's intensions were. :-P

I find it annoying when I get 50 source code files, and there's not even a 
single sentence anywhere saying "this file deals with users" or "that file 
handles cookie storage" or something. How f'ing lazy do you have to be?

I got complemented on my comments the other day. They asked which tool I 
used to generate them. I said "Easy: I write the comments first to tell me 
what I need to implement."

> "The fmap function must satisfy fmap id == id and fmap (f . g) == fmap f .
> fmap g". Or you can say "fmap applies a function to every element of a
> container without affecting the structure of the container itself". The
> latter tells you what the function is *for*.

Yes. I usually include both. But unit tests tell you the first, so the 
people who tell you that unit tests serve as documentation are also wrong. :-)

>>> I've never heard of a system which actually /compiles/ templates.
>>
>> Any template system written in a compiled language, like ASP.NET.
>
> It's also news to me that ASP.NET is compiled. I thought it was just another
> scripting language.

ASP was. ASP.NET is C# or VB.NET implementing the logic.

>> Heck, GWT takes Java code and compiles the half that runs on the browser
>> into optimized javascript.
>
> That's pretty hardcore, right there.

It's really quite insane, yes.

>>> I'm not seeing how type erasure is in any way related to the ability or
>>> inability to dynamically load new code.
>>
>> If you don't know what types are in the code you're loading, how do you
>> load it?
>
> Doesn't seem to stop C. :-P

That's because C isn't strongly typed.

> Well, yeah, being able to smoothly transition from one to the other is much
> nicer. I suppose you might perhaps be able to do that by having multiple
> physical servers and bouncing them one at a time? (I'm just trying to think
> of obvious ways that might go wrong...)

Yes. That's my point. If you don't have enough servers you can do that, then 
you don't have enough servers that you can repair your hardware.

> (I'm assuming here that you're only using a user ID in the URL to allow
> people to view somebody's public user profile. You should NOT be using this
> for actual authentication or anything like that...)

Yep. Unless you sign it or something.

> Required XKCD quote: http://www.xkcd.com/934/ [Esp. the alt. text.]

Indeed. He missed HTTP fumblingly reinventing all the stuff that others had 
already implemented, like persistent connections, chunked downloads, etc etc 
etc.

> But WTF do I know?

I agree entirely.

> I am *definitely* not one of those people. I doubt I'll ever write anything
> that actually gets hit by more than 2 users concurrently.

Not at your current job, for sure. :-)

> Dude, accountants *invented* the concept of "transactions"! :-D

Heh. Pretty much, yes.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Orchid XP v8
Subject: Re: Web frameworks
Date: 19 Nov 2011 15:35:19
Message: <4ec81307@news.povray.org>
>> Is it actually true that the /entire/ phone system is Erlang? I know
>> Ericson
>> use it, but is it really running *everything*?
>
> I don't know. It runs the critical 100%-uptime infrastructure.

Sometimes, people make it sound like Erlang is some kind of silver 
bullet that makes everything perfect. I think I can pretty much 
guarantee that all that 100% uptime stuff has a crapload of coders, 
testers, and on-call fault diagnostics engineers behind it. It's not 
like you just write the code in Erlang and it magically becomes reliable.

>> I should think that /any/ system is eventually going to come to a point
>> where you need real documentation. There are those who say "the source
>> *is*
>> the documentation". But looking at Yesod, with almost 100 packages, I
>> wouldn't want to have to read all that lot to try to /guess/ what the
>> designer's intensions were. :-P
>
> I find it annoying when I get 50 source code files, and there's not even
> a single sentence anywhere saying "this file deals with users" or "that
> file handles cookie storage" or something. How f'ing lazy do you have to
> be?

Well, if there's a module named "Cookies", then it's a pretty good bet 
what that does. Then again, if you're looking for the bit that lets you 
pretend that HTTP is stateful, is that in the Cookies module, or the 
HTTP module, or somewhere else? Sometimes it's not very obvious. No 
module ever does just *one* thing - and yet it must have just *one* name.

> I got complemented on my comments the other day. They asked which tool I
> used to generate them. I said "Easy: I write the comments first to tell
> me what I need to implement."

Yeah, that could work. I mean, it wouldn't work with my usual iterative 
prototyping method, but hey...

>> "The fmap function must satisfy fmap id == id and fmap (f . g) == fmap
>> f .
>> fmap g". Or you can say "fmap applies a function to every element of a
>> container without affecting the structure of the container itself". The
>> latter tells you what the function is *for*.
>
> Yes. I usually include both. But unit tests tell you the first, so the
> people who tell you that unit tests serve as documentation are also
> wrong. :-)

Heh, yeah. And for that matter, some properties are too hard to write 
unit tests for. (E.g., you can test that two different functions produce 
the same result for every input you can think of, but it's rather harder 
to *prove* that it works for *all* inputs.)

>> It's also news to me that ASP.NET is compiled. I thought it was just
>> another scripting language.
>
> ASP was. ASP.NET is C# or VB.NET implementing the logic.

Oh, I see.

>>> Heck, GWT takes Java code and compiles the half that runs on the browser
>>> into optimized javascript.
>>
>> That's pretty hardcore, right there.
>
> It's really quite insane, yes.

It's actually the sort of thing I've been thinking about trying to do 
myself. As a matter of fact, there is apparently an extension for one of 
the more experimental Haskell compilers that compiles Haskell to JS 
rather than machine code. (If the compiler can compile it at all, that 
is... It's still experimental, after all.)

>>>> I'm not seeing how type erasure is in any way related to the ability or
>>>> inability to dynamically load new code.
>>>
>>> If you don't know what types are in the code you're loading, how do you
>>> load it?
>>
>> Doesn't seem to stop C. :-P
>
> That's because C isn't strongly typed.

OK. So before you erase the types, note down enough information to allow 
dynamic loading. It's not that hard. [People have managed to do it for 
Haskell, for example.]

>> Well, yeah, being able to smoothly transition from one to the other is
>> much
>> nicer. I suppose you might perhaps be able to do that by having multiple
>> physical servers and bouncing them one at a time? (I'm just trying to
>> think
>> of obvious ways that might go wrong...)
>
> Yes. That's my point. If you don't have enough servers you can do that,
> then you don't have enough servers that you can repair your hardware.

OK.

>> Required XKCD quote: http://www.xkcd.com/934/ [Esp. the alt. text.]
>
> Indeed. He missed HTTP fumblingly reinventing all the stuff that others
> had already implemented, like persistent connections, chunked downloads,
> etc etc etc.

Unfortunately, every PC on Earth has a web browser installed. If you 
want to use some other protocol, you have to have the software for it 
first. That's why Hotmail got started. (And as best as I can tell, 
that's where this whole crazy idea originated.)

>> But WTF do I know?
>
> I agree entirely.

Irony? ;-)

>> I am *definitely* not one of those people. I doubt I'll ever write
>> anything that actually gets hit by more than 2 users concurrently.
>
> Not at your current job, for sure. :-)

I hadn't thought of that. Yeah, I guess we sometimes have more than 2 
users log in at once while I'm scanning their profile folders. :-P

>> Dude, accountants *invented* the concept of "transactions"! :-D
>
> Heh. Pretty much, yes.

Ooo, and recording everything twice, for error recovery. (They call it 
"double-entry book keeping". We call it "write-ahead logging".)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Web frameworks
Date: 20 Nov 2011 11:58:27
Message: <4ec931b3$1@news.povray.org>
On 11/19/2011 12:35, Orchid XP v8 wrote:
> It's not like you just write the code in
> Erlang and it magically becomes reliable.

No, of course not. You certainly have to write the code to be 
fault-tollerant. The difference is that in Erlang it's much easier, and you 
have bunches of libraries to help out.

> Well, if there's a module named "Cookies", then it's a pretty good bet what
> that does.

Yeah, if only everything was named that well.

> Yeah, that could work. I mean, it wouldn't work with my usual iterative
> prototyping method, but hey...

You would be surprised. You can still write a one or two sentence comment at 
the start of a function before you code it. It's no harder than deciding 
what to name the function and the arguments. And of course you go back and 
fix the comments as you code.

> result for every input you can think of, but it's rather harder to *prove*
> that it works for *all* inputs.)

Yeah. You can throw a bunch of random data at both, tho.

> OK. So before you erase the types, note down enough information to allow
> dynamic loading. It's not that hard. [People have managed to do it for
> Haskell, for example.]

Well, sure. As long as your interface is skinny enough that you can do that, 
then you're golden.

> Unfortunately, every PC on Earth has a web browser installed.

And, more importantly, every firewall has a hole for port 80. *That* was the 
real impetus.

> why Hotmail got started. (And as best as I can tell, that's where this whole
> crazy idea originated.)

Nah. There were lots of systems putting apps over http because it would go 
thru firewalls long before anyone tried to reimplement stuff that everyone 
already had software for like email.

> Ooo, and recording everything twice, for error recovery. (They call it
> "double-entry book keeping". We call it "write-ahead logging".)

Journaling. :-)

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Invisible
Subject: Re: Web frameworks
Date: 21 Nov 2011 04:27:07
Message: <4eca196b$1@news.povray.org>
>>> Aren't defense contractors all using ADA? Or did that change over the
>>> last 10 years?
>>
>> "All" might be an exaggeration. But you're right, there's probably more
>> of them using Ada than there are using Haskell...
>
> It used to be a requirement for US DoD contractors, and since most NATO
> countries shop at the same places, everyone was using ADA.

Rechecking my sources, it seems there's one company in Ohio that claims 
to be a defence contractor, and which uses Haskell for building AI systems.

http://cufp.galois.com/2006/slides/GaryMorris.pdf

(Interestingly, the company's web server currently won't answer me...)


Post a reply to this message

<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.