Re: Ideal computer language from scratch?
- From: "Dragontamer" <prtiglao@xxxxxxxxx>
- Date: 24 Feb 2006 13:23:53 -0800
Betov wrote:
"Dragontamer" <prtiglao@xxxxxxxxx> écrivait news:1140812218.618548.154330
@u72g2000cwu.googlegroups.com:
[... Pathetic bullshits... ]
Confusing Methods and Language will never help
you at understanding anything. Mind you, the
day Assembly will not allow a programmer to do
something, no HLL will ever do this something
either.
You are welcome to an opinion.
But regardless; could you explain to me (don't even need to program or
show code) how you'd
implement the following functional methods in assembly language
(without resorting
to using or creating an external scripting language of some sort,
because you'd just
be creating another language to fill the holes that Assembly cannot do
by itself):
1. First order Functions; aka, functions as data.
2. Defining functions as combinations of data
3. Currying
4. Lazy data structures (such as an infinitly long list)
5. Guarentee a lack of side effects in a specific function
6. Creating a function during runtime
Mind you; i remember Randall writing how to pass data by lazy
evaluation in his
"Art of Assembly" book. So if Randall can come up with number 4, i'm
sure you can as
well :-p
Now; to disprove your statement; all 6 of those exist in Haskell, thus
it is something
Haskell (a very HLL) can do, that assembly cannot do.
1. Haskell basically only deals with functions. All data is concieved
as a function
that only returns one value.
2. The foldr example in my last post was Haskell code.
3. Again, the concept in my last post was a currying example in
Haskell.
4. fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
Again, haskell. Scheme also provides a way for lazy evaluation wit
"delay" and "force"
5. Well, more of a feature of Haskell and not really anything you can
do in assembly.
Haskell guarentees a lack of side-effects for the majority of the
functions you define,
allowing the programmer to know that the function will always work the
same regardless.
So I cheated by including this one :) knowing Assembly simply cannot
guarentee this.
(else, it wouldn't be assembly, would it). But with that said, it is a
programming method
that Haskell supports that Assembly doesn't.
Now, to stop confusion: Haskell allows side effects through control
structures called
"Monads". So yes, you can create a pseudo random generator.
6. Haskell can do this with lambda function. Ditto with Scheme and
Lisp, and python.
It *defines* a new function; during runtime. So you can read in a file
for example, and
create a new function based on the file's inputs, or the user's input,
or data from
a network.
Again, explain how to do these in Assembly without creating another
(scripting) language
for support. The only way I (personally) can think of doing these in
Assembly is by
writing a simplified Haskell interpreter and embedding it into assembly
:-p
(well, enough of an interpreter to support runtime "lambda" statements,
and represent
functions during runtime)
Now seriously: I don't think you could learn *any* core concept of
"functional programming"
(the term used to describe programming using lazy evaluation, runtime
functions,
generators, lambda etc. etc.) in assembly language.
Actually, again, i remember Randall talking about how to do Lazy Eval
in Assembly, so
hope is not lost :-p So i change my stance to *most* concpets of
functional programming
can't be done in assembly.
--Dragontamer
.
- Follow-Ups:
- Re: Ideal computer language from scratch?
- From: sevagK
- Re: Ideal computer language from scratch?
- From: randyhyde@xxxxxxxxxxxxx
- Re: Ideal computer language from scratch?
- From: Charles A. Crayne
- Re: Ideal computer language from scratch?
- From: Alex McDonald
- Re: Ideal computer language from scratch?
- From: Betov
- Re: Ideal computer language from scratch?
- References:
- Re: Ideal computer language from scratch?
- From: randyhyde@xxxxxxxxxxxxx
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Dragontamer
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Chewy509
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Dragontamer
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: randyhyde@xxxxxxxxxxxxx
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Dragontamer
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Dragontamer
- Re: Ideal computer language from scratch?
- From: \\\~\o/~///annabee
- Re: Ideal computer language from scratch?
- From: Dragontamer
- Re: Ideal computer language from scratch?
- From: Betov
- Re: Ideal computer language from scratch?
- Prev by Date: Re: Ideal computer language from scratch?
- Next by Date: Re: Ideal computer language from scratch?
- Previous by thread: Re: Ideal computer language from scratch?
- Next by thread: Re: Ideal computer language from scratch?
- Index(es):
Relevant Pages
|