POV-Ray : Newsgroups : povray.off-topic : An interesting feature Server Time
31 Oct 2024 21:25:34 EDT (-0400)
  An interesting feature (Message 1 to 2 of 2)  
From: Orchid Win7 v1
Subject: An interesting feature
Date: 14 Oct 2012 05:12:49
Message: <507a8211$1@news.povray.org>
...or not...

OK, so as you know, Haskell is a statically-typed language, much like 
Pascal, C, C++, C#, Java, Eiffel, Delphi and God knows how many other 
programming languages. What that means is that if (for example) you try 
to multiply a Customer by a Date, you get a compile-time error, and your 
program won't compile, so you can't run it.

Usually this is a Very Good Thing. However, if you're in the middle of 
trying to refactor a complex piece of code, it can be annoying. You just 
changed one part, and you want to quickly test it, but you can't because 
you just broke the rest of the code in that module.

The latest release of GHC adds an interesting new feature. If you turn 
this feature on, then type mismatches become compile-time /warnings/ 
instead of /errors/. So your code now compiles, and you can test the 
bits you've fixed, without the bits you haven't fixed preventing the 
compilation.

But what happens if you try to run some of the code that doesn't 
type-check? Well, quite simply, it runs as much of the code as it can, 
and then throws an exception.

To my knowledge, there aren't many statically-typed languages that let 
you do this. Most of the time, you'd have to comment-out all the 
incorrect code, usually by hand.

Then again, statically-typed, compiled languages which can also be 
executed interactively are fairly uncommon in the first place, so...


Post a reply to this message

From: Darren New
Subject: Re: An interesting feature
Date: 20 Oct 2012 13:09:41
Message: <5082dad5$1@news.povray.org>
On 10/14/2012 2:12, Orchid Win7 v1 wrote:
> Then again, statically-typed, compiled languages which can also be executed
> interactively are fairly uncommon in the first place, so...

I wonder how Rosilyn handles this, that being the new component of C# that 
lets you build things like REPL loops by being able to pass bits of source 
code to be compiled into a "program" object.

-- 
Darren New, San Diego CA, USA (PST)
   "They're the 1-800-#-GORILA of the telecom business."


Post a reply to this message

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