Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #29423 > unrolled thread

Creating a lisp compiler

Started byHi-tech Robert <hitechrobert@gmail.com>
First post2014-04-08 00:16 -0700
Last post2014-04-16 11:46 +0100
Articles 8 — 7 participants

Back to article view | Back to comp.lang.forth


Contents

  Creating a lisp compiler Hi-tech Robert <hitechrobert@gmail.com> - 2014-04-08 00:16 -0700
    Re: Creating a lisp compiler Paul Rubin <no.email@nospam.invalid> - 2014-04-08 00:41 -0700
    Re: Creating a lisp compiler "Elizabeth D. Rather" <erather@forth.com> - 2014-04-07 22:20 -1000
    Re: Creating a lisp compiler "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-08 06:04 -0400
    Re: Creating a lisp compiler Mark Wills <markwills1970@gmail.com> - 2014-04-08 03:32 -0700
    Re: Creating a lisp compiler hughaguilar96@yahoo.com - 2014-04-13 00:04 -0700
    Re: Creating a lisp compiler Hi-tech Robert <hitechrobert@gmail.com> - 2014-04-15 02:12 -0700
      Re: Creating a lisp compiler "Alex McDonald" <blog@rivadpm.com> - 2014-04-16 11:46 +0100

#29423 — Creating a lisp compiler

FromHi-tech Robert <hitechrobert@gmail.com>
Date2014-04-08 00:16 -0700
SubjectCreating a lisp compiler
Message-ID<35a650bd-b706-495e-b4a0-b1c15797d474@googlegroups.com>
Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive my ignorance, any advice how?

[toc] | [next] | [standalone]


#29424

FromPaul Rubin <no.email@nospam.invalid>
Date2014-04-08 00:41 -0700
Message-ID<7xvbukclov.fsf@ruckus.brouhaha.com>
In reply to#29423
Hi-tech Robert <hitechrobert@gmail.com> writes:
> Hi, I am planning an OS for a Google glass-like hobby project I am
> working on. I am hoping to use Forth to create an assembler for lisp
> and Haskell. I am new to this language so please forgive my ignorance,
> any advice how?

Sorry, there is not yet an app to turn buzzwords into code.  

[toc] | [prev] | [next] | [standalone]


#29427

From"Elizabeth D. Rather" <erather@forth.com>
Date2014-04-07 22:20 -1000
Message-ID<5J-dnYd-OuiqLN7OnZ2dnUVZ_qudnZ2d@supernews.com>
In reply to#29423
On 4/7/14 9:16 PM, Hi-tech Robert wrote:
> Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive my ignorance, any advice how?
>

Well, you have to start by learning the basics of Forth. You can start 
with any well-documented Forth, including the free evaluation version of 
SwiftForth from FORTH, Inc. or one of the Open Source versions such as 
GForth.

SwiftForth includes not only its system-specific documentation but also 
the Forth Programmer's Handbook, a general reference manual for 
contemporary Forth. You may also use Forth Application Techniques, my 
tutorial textbook with many examples and exercises, that work with any 
current Standard Forth. It's available from Amazon, and inexpensive.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#29431

From"Rod Pemberton" <dont_use_email@xnothavet.cqm>
Date2014-04-08 06:04 -0400
Message-ID<op.xdzsx4lb6zenlw@localhost>
In reply to#29423
On Tue, 08 Apr 2014 03:16:38 -0400, Hi-tech Robert  
<hitechrobert@gmail.com> wrote:

> Hi, I am planning an OS for a Google glass-like hobby project I
> am working on.

...

> I am hoping to use Forth to create an assembler for lisp and
> Haskell.

Generally, assemblers are coded in assembly, or they're coded in the
language they're for, i.e., in lisp for lisp.  You're asking how to
produce a cross assembler.  Thoae are far less common.  In Forth
terminology, a cross compiler is called a meta-compiler.  So, I'm
assuming a cross assembler is called a meta-assembler.

> I am new to this language so please forgive my ignorance, any
> advice how?

Assemblers can be complicated, or not.  It depends heavily on the
assembly language for the specific microprocessor in question.
E.g., the x86 instruction set has some complicated encodings.

The rudimentary concepts are you parse syntax which tells you which
instruction to assemble and how the instruction format for that specific
instruction is to be filled in.  The information that needs to be
filled in can be a variety of things, such as offsets, bits to select
a register or memory location, etc.  This requires a bunch of bit
fiddling, with AND OR XOR etc.  The microprocessor instruction
manual for the microprocessor in question should show you the format
for each instruction.  Generally, Forth programmers concoct their
own syntax for a specific assembly language, whereas other coders
will use the syntax provided by the microprocessor instruction manual.
This is because Forth's have a limited but functional parser built into
the language.

As for using the Forth language to do this, others here will have to
help you.


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#29435

FromMark Wills <markwills1970@gmail.com>
Date2014-04-08 03:32 -0700
Message-ID<b8edd601-4731-492f-9e8f-a5ee91c74cc3@googlegroups.com>
In reply to#29423
On Tuesday, 8 April 2014 08:16:38 UTC+1, Hi-tech Robert  wrote:
> Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive my ignorance, any advice how?

Any advice on how to implement an assembler for Lisp and Haskell? Stop. If you're new to Forth, on what basis did you determine that Forth is the correct language to use to implement said assemblers?

Seems you are (or should be) a *long* way away from cutting code. I think you should still be gathering the requirements. I understand it's a hobby project, but a proper set of requirements (and therefore goals/milestones) will increse the probability of your project reaching completion. Too many hobby projects (including some of my own) fail because of the "dive in" approach, only to hit a road-block some 50% of the way in!

[toc] | [prev] | [next] | [standalone]


#29602

Fromhughaguilar96@yahoo.com
Date2014-04-13 00:04 -0700
Message-ID<f4e7d3a6-0762-43dd-83cb-e06e6bd8bb5f@googlegroups.com>
In reply to#29423
On Tuesday, April 8, 2014 12:16:38 AM UTC-7, Hi-tech Robert wrote:
> Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive my ignorance, any advice how?

You're writing an OS and a Lisp and a Haskell, and a "Google glass-like hobby project" (whatever the heck that is)? I would recommend that you do one thing at a time, and start with something that is achievable.

If you want to learn x86 assembly language, go with HLA --- it is for novices --- write a small fun program as a first effort.

[toc] | [prev] | [next] | [standalone]


#29660

FromHi-tech Robert <hitechrobert@gmail.com>
Date2014-04-15 02:12 -0700
Message-ID<82222d9c-90dc-461e-bdb0-52d82ea1f6ec@googlegroups.com>
In reply to#29423
On Tuesday, April 8, 2014 3:16:38 PM UTC+8, Hi-tech Robert wrote:
> Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive my ignorance, any advice how?

Amendment: I mean a compiler, not assembler. An assembler is way beyond my ability...

[toc] | [prev] | [next] | [standalone]


#29680

From"Alex McDonald" <blog@rivadpm.com>
Date2014-04-16 11:46 +0100
Message-ID<liln20$jnb$1@dont-email.me>
In reply to#29660
on 15/04/2014 10:12:17, Hi-tech Robert wrote:
> On Tuesday, April 8, 2014 3:16:38 PM UTC+8, Hi-tech Robert wrote:
>> Hi, I am planning an OS for a Google glass-like hobby project I am working on. I am hoping to use Forth to create an assembler for lisp and Haskell. I am new to this language so please forgive 
my ignorance, any advice how?
> 
> Amendment: I mean a compiler, not assembler. An assembler is way
> beyond my ability...
> 

What is it you are trying to do? An OS or a compiler? If a compiler, I
still can't understand this, even with your correction; "I am hoping to
use Forth to create a compiler for lisp and Haskell." If an assembler is
way beyond your ability, a compiler is several times further. Then
multiply by the distance between you and Forth; it's currently infinite.

Please expalin what it is you wish to do. You're describing the tools,
not the product.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web