Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #485
| From | BGB <cr88192@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.misc, comp.programming |
| Subject | Re: Time for a new language? |
| Date | 2011-06-17 10:55 -0700 |
| Organization | albasani.net |
| Message-ID | <itg4lf$rn2$1@news.albasani.net> (permalink) |
| References | (2 earlier) <isjhsq$vt8$1@speranza.aioe.org> <043628bb-8b8b-4094-8e7b-b1c61a69b525@c41g2000yqm.googlegroups.com> <95ve6hFqkrU1@mid.individual.net> <itere2$tm4$1@news.albasani.net> <11ea403b-f29d-4dd3-87de-494636f0abb3@h7g2000yqa.googlegroups.com> |
Cross-posted to 2 groups.
On 6/17/2011 1:39 AM, tm wrote: > On 17 Jun., 08:11, BGB<cr88...@hotmail.com> wrote: >> On 6/16/2011 3:25 PM, Ian Collins wrote: >> >> >> >>> On 06/ 7/11 08:17 PM, tm wrote: >> >>>> I consider Seed7 higher level than Java and C++ because Seed7 >>>> defines things in libraries that Java and C++ have hard-coded in >>>> their compilers. So I consider arrays defined with an abstract data >>>> type as higher level than hard-coded arrays. >> >>>> To see how hard-coded things work, look at the C conversions for >>>> numeric values. Chapter A6 of ANSI-K&R distinguishes between: >>>> Intergral Promotion >>>> Integral Converions >>>> Integer and Floating >>>> Floating Types >>>> Arithmetic Conversions >>>> Pointers and Integers >>>> The rules are not simple, and they changed between K&R-C and ANSI-C. >> >>> They may not be simple, but they are well understood and contribute to >>> the metaphors that enable C programmers to understand each other's code. >> >> yeah, and generally the rules make sense... > > You are probably used to them. Sometimes it helps to > take a step backward (to get a broader view). A neutral > outsider would probably have a different view on the rules. > the type tower, promotion rules, ... are not magic. >>>> All this rules are hardcoded in every C compiler. Seed7 has no such >>>> rules. There are just definitions of operators and functions for >>>> numeric types. I consider that this simplification makes Seed7 >>>> (besides other things) higher level than C. >> >>> Isn't that a recipe for write only code? The reader not only has to >>> follow the logic the code attempts to express, but also the rules used >>> to express the logic. >> >> yeah... >> >> in my case, I think it much more sensible to hard-code all the basics, >> and allow plugins for the rest... > > Plugins are a fashion now. Firefox, Eclipse and many other > programs use them. It is iteresting to see that my ideas > become acceptable, when the term plugin is used. But plugins > are IMHO a much more low level concept to reach the same goal. > A plugin usually has access to the data structure of the main > program via an API. I see my approach with syntax definitions > (see: http://seed7.sourceforge.net/manual/syntax.htm) and > function definitions (which use the new introduced syntax) > as much more high level. > probably everyone here knows by now how you are doing things... I am doing things differently, mostly hard-coding most core parts of the language, and using plugins for the rest. >> for example, consider a person wants to add "some feature X" to the >> language, how may they do it?... >> >> well, they can create a loadable component which: >> plugs itself into the parser, ... >> plugs itself into the bytecode compiler so, ... >> maybe plugs into the bytecode VM, ... > > What a complicated concept. You need to know the internals > of parser, compiler and VM to do that. > most of it is done via API, most of which can abstract over a lot of the "ugly details". partly, this is called "abstraction". anyways, one could argue the same thing against, say, Lisp, because you need to know all these ugly details of how Lisp works in order to use it. most of the low-level VM interfacing would likely involve a lot of dynamic types and S-Expressions, as this is a large part of what the VM is built on (most of these APIs are independent of the VM itself). although not perfect, the parser API mostly boils down to S-Expressions / Lists and a "char **" pointer (the latter may be wrapped in some sort of API, as to hide its "char **" nature). actually, the AST format is vaguely similar to Scheme, albeit with some alterations over the years mostly to address representation issues. the main alternative would have been XML based, but it seems at this point, S-Exps won this particular game. either way, it is not assumed here that newbies will be sitting around writing VM plugins, as FWIW, newbies will make nastiness of pretty much any feature they use. > I suggest that a person who wants to add "some feature X" > takes a look at Seed7. :-) > >> ultimately, this is probably good enough, ... > > This must be a joke. You expect that people know the > internals of your parser, compiler and VM to do something > that Seed7 can do in just a few lines? > FWIW, this may not matter. the main use for language extensions would likely be to add DSL-like functionality, which would ultimately depend mostly on the host app. it then allows a host app, presumably written in C or C++, to plug in whatever new features it needs. the language doesn't really need to be self-extending, because this isn't really all that likely to be useful. >>>> I consider things, that everybody can define, as higher level than >>>> hard-coded do what I mean concepts (that only authors of compilers >>>> and interpreters can change). >> >>> That's a bit like saying Leggo is the highest level toy... >> >> yeah, Lego is probably a lower-level toy, if anything because one is >> building things out of blocks, rather than out of pre-formed pieces. > > You probably haven't played with Lego for a long time. > (I have children, so I see what Lego provides now). > Now they use a lot of pre-formed pieces which allow some > things to be build more quickly. But this has the > disadvantage that some things become impossible to create. > >> FWIW, ASM also allows building programs out of large numbers of >> fundamental parts, and this is generally called low-level. > > ASM has a 1:1 mapping to machine code, this was the reason > it was considered a 2nd generation language. > yes, and as a child (elementary-school years) ASM (along with BASIC, namely QBasic) was one of the earlier languages I learned... initially, I actually understood ASM a bit better than C, but C had its merits which made me mostly switch to it as my primary language (actually, early on I partly learned C by compiling programs to ASM and then reading the ASM output, giving me more a grasp on what some of these code fragments were doing). at one point I had tried, without all that much success, to bridge between ASM and QBasic. what finally killed me using Basic was (then in middle school) jumping ship to Linux as my main OS for a number of years, where Linux didn't have QBasic, so most new code was written solely in C. and then many years went by...
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-07 01:17 -0700
Re: Time for a new language? BGB <cr88192@hotmail.com> - 2011-06-07 03:07 -0700
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-07 04:21 -0700
Re: Time for a new language? "BartC" <bc@freeuk.com> - 2011-06-07 11:26 +0100
Re: Time for a new language? pete <pfiland@mindspring.com> - 2011-06-07 07:45 -0400
Re: Time for a new language? BGB <cr88192@hotmail.com> - 2011-06-07 13:02 -0700
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-07 12:49 -0700
Re: Time for a new language? gremnebulin <peterdjones@yahoo.com> - 2011-06-13 16:36 -0700
Re: Time for a new language? Ian Collins <ian-news@hotmail.com> - 2011-06-17 10:25 +1200
Re: Time for a new language? BGB <cr88192@hotmail.com> - 2011-06-16 23:11 -0700
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-17 01:39 -0700
Re: Time for a new language? "H.J. Sander Bruggink" <sander.bruggink@uni-due.de> - 2011-06-17 11:05 +0200
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-17 02:54 -0700
Re: Time for a new language? BGB <cr88192@hotmail.com> - 2011-06-17 10:55 -0700
Re: Time for a new language? tm <thomas.mertes@gmx.at> - 2011-06-17 00:55 -0700
csiph-web