POV-Ray : Newsgroups : povray.off-topic : 80 / 20 rule Server Time
5 Jul 2024 08:14:34 EDT (-0400)
  80 / 20 rule (Message 10 to 19 of 19)  
<<< Previous 9 Messages Goto Initial 10 Messages
From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 18 Oct 2015 14:23:35
Message: <5623e3a7$1@news.povray.org>
On 18/10/2015 04:37 PM, nemesis wrote:
> Orchid Win7 v1<voi### [at] devnull>  wrote:
>> Actually, there used to be more. (NHC, YHC, Hugs, Helium, ...) It seems
>> that GHC is so good now, that nobody thinks they can beat it. All the
>> other implementations have gone quiet. (Also, GHC is the only one funded
>> by Microsoft. All the others were hobby projects.)
>
> oh, yes
>
> Microsoft, the eternal monopoly
>
> they also hired the main researchers for the language and it gave fruits as
> insights for C#'s LINQ and a couple of other features and F#

Oh, you noticed?

It used to be possible to say "hey, look at this Java code. Now look at 
the same thing in Haskell. See how it's 500% shorter and easier to 
comprehend?" But now you can more or less do the same thing in C#, for 
the *common cases* that are easy to demonstrate in a 3-line snippet. 
Trust me, there's still plenty that's easier in Haskell than C#. It's 
just not quite so easy to demo now. :-{

I'm just glad they don't meddle with the actual development of GHC. That 
stays freeware and open-source.

> please don't tell me you use notepad, dude
>
> any halfassed code editor ever since the 70's comes with some parentheses
> matching and coloring resources.  Even web editors in javascript.  It allows for
> quickly going up or down the nested structures as well as selecting a whole
> large section with a single move.

Most editors will highlight the brace matching the one you're currently 
pointing at. But if your source code is 85% braces, anything short of 
colour-coding every single brace with a unique colour is pretty unreadable.

> anyway, the whole metalanguage thing in Lisps may be easier to implement because
> of homoiconicity, but is no different than in other languages:  expansion takes
> place /before/ compilation.  There is eval to construct real new code at
> runtime, but as in javascript and a few others, it's shunned as the performance
> hog it is and function composition is preferred.

OK. So eval actually goes slower. I was half expecting the entire 
compiler to be included at run-time. (Mind you, for something as simple 
as Lisp, maybe it's not that hard...)

>> 3. Implicit types.
>
> type inference no doubt is a real dog...

Actually, this is one of those joyful moments when you look at the 
algorithm and go "oh... that sounds really simple!" It's quite elegant, 
really. Don't get me wrong, there's a butt-load of obscure ways it can 
go wrong, which will leave you scratching your head. But the main idea 
is quite beautiful.

Doing this in a language with subtype polymorphism, OTOH, sounds 
nightmarish. Just for giggles, go look up the Eiffel rules for when one 
generic type is or isn't a subtype of another generic type. It's mental! ;-)

>> 4. Laziness. It depends what you're compiling to, but if you compile to
>> some machine-level language, it's *really complicated* to implement
>> laziness! It 100% *requires* a garbage collection engine, and it's quite
>> fiddly to bind you mind around. If you're compiling to the JVM or
>> something, some of these problems go away.
>
> which is funny, because I never heard of a haskell compiler for java.

I guess you haven't heard of Frege then.

(It's a language that's 98% like Haskell, but just different enough to 
prevent all your existing Haskell code from working on it.)

Anyway, the compiler translates Frege into Java. Not JVM bytecode, 
actual Java source code. And supports calling native Java as foreign 
functions (much as GHC supports calling C).

> The JVM
> used to have no tail-call optimization primitive, which is a necessity for
> functional languages.

I suspect you can use a trampoline to get around that. I am not an 
expert in such matters.

Oh, and there's the experimental GHCJS, which is a mod of GHC that 
compiles to JavaScript. For realz.


Post a reply to this message

From: nemesis
Subject: Re: 80 / 20 rule
Date: 18 Oct 2015 15:30:00
Message: <web.5623f24d549340f094c8e9160@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> It's
> just not quite so easy to demo now. :-{

we should all be programming in javascript anyway...

> if your source code is 85% braces, anything short of
> colour-coding every single brace with a unique colour is pretty unreadable.

that's crazy. It's a great aid for editing, but other than that Lispers see it
as whitespace.  That's why they don't match visually ) to the respective (, just
clutter all of them together at the end of an expression))).  One usually opens
a pair with a single keystroke and then is put inside it to begin writing.  A
Lisper really doesn't manually deals with them.

editors usually shade the whole region in gray


> OK. So eval actually goes slower. I was half expecting the entire
> compiler to be included at run-time. (Mind you, for something as simple
> as Lisp, maybe it's not that hard...)

some indeed have compile along with eval

>
> But the main idea
> is quite beautiful.

yes, Hindley-Milner


> I suspect you can use a trampoline to get around that. I am not an
> expert in such matters.
>
> Oh, and there's the experimental GHCJS, which is a mod of GHC that
> compiles to JavaScript. For realz.

that's the distributed webOS


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 25 Oct 2015 09:22:36
Message: <562cd79c$1@news.povray.org>
On 17/10/2015 02:09 PM, Orchid Win7 v1 wrote:
> I've been a Haskell programmer for [at least] 10 years, and I've never
> seen *anybody* do this!

In other news:

   let (,) x y = (5, 6)

This is legal. Bizarre, but true!



Suppose you have a 3-argument constructor:

   data Fubar = Three Char Char Char

Now you can write something like

   Three 'J' 'F' 'K'

which creates a Fubar value. But if you write just Three by itself, you 
have a 3-argument function. As you'd expect.

You can create a 3-argument tuple like this:

   (True, "Red", foo)

Weirdly, if you write

   (,,)

this is a 3-argument function that constructs a 3-tuple. (Count the 
commas carefully; notice how a *three* tuple has *two* commas in it!)

This is a fairly obscure language feature; it's mostly useful when you 
want to quickly pass a tupling function as an argument to something:

   zip = zipWith (,)

However, strictly speaking, that means it's legal to write

   (,,) True "Red" foo

which is exactly the same as (True, "Red", foo), but with weirder syntax.

I had no idea that this is also legal *pattern* syntax! I can't imagine 
why the heck you'd ever want to write it this way in a pattern. But it's 
legal. So there.


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 25 Oct 2015 10:48:13
Message: <562cebad$1@news.povray.org>
On 17/10/2015 02:09 PM, Orchid Win7 v1 wrote:
> I've been a Haskell programmer for [at least] 10 years, and I've never
> seen *anybody* do this!

In other news...

It turns out guards are weirder than I thought! Most humans use them 
like this:

   fibonacci n | n == 0    = 1
               | n == 1    = 1
               | otherwise = fibonacci (n-1) + fibonacci (n-2)

Or maybe

   fibonacci n
     | n == 0    = 1
     | n == 1    = 1
     | otherwise = fibonacci (n-1) + fibonacci (n-2)

But it turns out, it's 100% legal to do this:

   fibonacci n | n == 0 = 1 | n == 1 = 1 | otherwise = ...

How bizarre! I had no idea you could do this... I had assumed the layout 
rule applies. But, apparently, it does not. So long as all the guards 
end up in the same block, it literally doesn't matter. Who knew?

(I suppose most of this basically boils down to "most people don't use 
guards very much anyway"...)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 26 Oct 2015 15:09:01
Message: <562e7a4d$1@news.povray.org>
On 17/10/2015 01:45 PM, Orchid Win7 v1 wrote:
> I'm talking about the rule that says that 80% of people only use 20% of
> the available functionality. Or that 20% of the development effort
> implements 80% of the functionality, and the last 80% of developer time
> is required to do that last 20% of functionality.

281,309 tests
281,309 passed
0 failed

Time to initiate phase 2, I guess...


Post a reply to this message

From: clipka
Subject: Re: 80 / 20 rule
Date: 27 Oct 2015 07:30:42
Message: <562f6062$1@news.povray.org>
Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:

> 281,309 tests
> 281,309 passed
> 0 failed

Congratulations - you have successfully driven all bugs into hiding ;)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 27 Oct 2015 14:51:29
Message: <562fc7b1$1@news.povray.org>
On 27/10/2015 11:30 AM, clipka wrote:
> Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:
>
>> 281,309 tests
>> 281,309 passed
>> 0 failed
>
> Congratulations - you have successfully driven all bugs into hiding ;)

Congratulate me when I've written tests that actually cover everything. :-}


Post a reply to this message

From: clipka
Subject: Re: 80 / 20 rule
Date: 28 Oct 2015 06:55:54
Message: <5630a9ba$1@news.povray.org>
Am 27.10.2015 um 19:51 schrieb Orchid Win7 v1:
> On 27/10/2015 11:30 AM, clipka wrote:
>> Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:
>>
>>> 281,309 tests
>>> 281,309 passed
>>> 0 failed
>>
>> Congratulations - you have successfully driven all bugs into hiding ;)
> 
> Congratulate me when I've written tests that actually cover everything. :-}

Just in case you didn't recognize the sarcasm: Remember that a bug in
hiding is nastier than a bug in the open :P

As for your request - sure; when hell freezes over, I'll congratulate
_everyone_ ;)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 28 Oct 2015 14:13:50
Message: <5631105e$1@news.povray.org>
>>> Congratulations - you have successfully driven all bugs into hiding ;)
>>
>> Congratulate me when I've written tests that actually cover everything. :-}
>
> Just in case you didn't recognize the sarcasm: Remember that a bug in
> hiding is nastier than a bug in the open :P

Well, I know for a fact that there are chunks of the grammar that I 
point-blank *haven't implemented yet*. Just because no tests exist for 
it yet, doesn't mean it works. ;-)

> As for your request - sure; when hell freezes over, I'll congratulate
> _everyone_ ;)

Tru, dat.


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: 80 / 20 rule
Date: 29 Oct 2015 16:53:38
Message: <56328752$1@news.povray.org>
On 26/10/2015 07:09 PM, Orchid Win7 v1 wrote:
> 281,309 tests
> 281,309 passed
> 0 failed
>
> Time to initiate phase 2, I guess...

...or not. So far I've found at least 3 tests where the expected result 
does not actually match the language specification. Yay for incorrect 
test cases!


Post a reply to this message

<<< Previous 9 Messages Goto Initial 10 Messages

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