...

View Full Version : Assembly..the key to all languages



velious
01-16-2004, 10:02 PM
...or so i was told..

I'll be in college in june and I wanted something real basic at first like assembly and work my way up to more complex languages like c or c++ when i become more experianced. I was told and please tell me if i am wrong, but assembly is the "key" to any language..if someone can learn assembly then they can learn any language...again, tell me if i'm mistaken. I am learning how to count in binary and hex, but is there anything else that you would recommend as far as skills or anything?..thanks :)

liorean
01-16-2004, 10:09 PM
I think you're beginning in the wrong end. It would be better if you began with higher level programming, I think, and then worked yourself down. The binary and hex thinking will become more and more important as you get closer and closer to the machine, but the actual thinking is easier in the more advanced languages. Now I should mention that I think C/C++ to be pretty low level, and that you should probably begin with a somewhat higher level language, such as Python, Ruby, Scheme, JavaScript, ML, Haskell. Don't start with Java though - it's high level, but it's conceptually C/C++ dropping the more low-level parts, and not adding much on it's own.

In assembly, you must think of what the processor should do. You must yourself convert an idea from a conceptual plan, an algorithm or a set of algorithms, into something that the processor can handle, and you must yourself make sure that eavrything works as intended once there, and that the way back into a concretisised program that the user can interface with works. The higher level languages take care of some of that for you. The really high level languages takes care of almost everything of that for you, and you can concern yourself more with the actual task you want handled.

As I said, I think working your way top down instead of bottom up is a better choice for learning.

Mhtml
01-17-2004, 02:56 AM
Yeah liorean is right (of couse he's right, he's always right) ... Myself I would suggest BASIC to start, Python is ok but it's a lot more complex (or at least can be) whereas you will be limited easily by BASIC, boundaries are good when beginning because they make you think of how you can do something and this develops good algorithm skills.

jkd
01-17-2004, 04:15 PM
BASIC? No, BASIC is harmful. Scheme or Python I think make good first languagesl

soccerdvy
01-20-2004, 03:10 AM
Personaly, I learned in Javascript first. It has a lot of benefiets, such as the fact that you dont have to re-compile every time you change the program, and you can work in an enviornment that a "newbie" may be more comfortable with, as opposed to a tool like EMACS for C++. Also, Javascript comes stock with virtually every internet browser, so there is no confusion about installation, or configuration. In fact, there is no setup required at all, making it easy for a newbie programmer to get started. Lastly, it has many of the features that you will find in ANY programming or scripting language, such as IF/ELSE statements, FOR loops, and the like. If you want a GREAT tut on Javascript, I would DEFFINIATLY recommend that you check out www.webmonkey.com (http://www.webmonkey.com).

velious
01-22-2004, 08:08 PM
I always thought of C/cpp as a high level languages..at least thats what all the books say. I have learned a bit of python and I personally think its better than javascript because in order to input data, you have to have to make html forms and then link'em..and for some reason i always have a problem with that..but i do know that JS and c/cpp have a very similar syntax..so i guess if i can learn c/cpp..then javascript is should not be that hard for me.

i have another question..is a high level language determined by how hard or easy the syntax is?..because i found python to be alot more simpler to learn than javascript in many ways..so in my possible incorrect theroy..python would be a low level language...But i trust that you guys are right, you know more than me :)

liorean
01-22-2004, 08:49 PM
Traditionally, "high level language" ment an abstract language (ie. a language that does not directly convert into machine code), while 'low level language' meant a language that converted directly into machine code. A low level language can always be reconstructed from the machine code it generates at compilation.

Nowadays, the scale is going up. Basic, C, COBAL, FORTRAN, Pascal might have been high level, but today there are many languages that are far higher level. C++ adds a bit to C, being object oriented among other things. Objective C adds another kind of object orientation and some level of automatic garbage collection. Java is not only object oriented but also object based and has full automatic garbage collection. Ruby and Python takes the step even longer, and adds some object oriented features from among others SmallTalk, and CLOS. They also both take features from functional and logical programming languages, such as proc blocks and closures. Ruby adds an object based model that is quite a lot more profound than that found in almost oll other languages. The functional languages such as LISP were already pretty high level when C/C++ took over the scene, and are today about the highest level languages you can find. Then there's a few other paradigms that you could talk about, but I've covered the largest groups of languages.

JavaScript comes in there right among the functional/object based/object oriented languages. It's got a syntax that closely resembles C/C++, but belongs more with the functional than the imperative paradigm. Same goes for Python. Ruby is a bit more imperative, others are a bit more functional. They aren't the best performance languages around, but they are abstracted to be more powerful than the lower level languages. They are pretty easy to learn, but have more or less hard-to-grasp syntax for the more powerful features. Don't be fooled to think that JavaScript would be a less useful language than the others in this group - JavaScript, especially the upcoming JavaScript2 version of the language, is very much a full feathered programming language, and has been optimised a lot more than for example Ruby has been. The problem with JavaScript is that the spec only covers the basic language and the syntax - there are no standard libraries for it. However, if you are in a good host environment, you have that fixed for you.

velious
01-22-2004, 10:59 PM
Thanks liorean

I that cleared up alot of confusion especially about javascript.

about python, what do i do if i want to give a python program to someone who does not have a compiler/interpreter or python installed on their system?..will it still work or do they have to install python first?

Mhtml
01-24-2004, 11:05 AM
Originally posted by jkd
BASIC? No, BASIC is harmful. Scheme or Python I think make good first languagesl

Well it depends, I started on BASIC ... of course long ago but I think it gives a very clear view of how sequential programming works. It's near english syntax is good for those who have no idea at all.

Never used scheme, but python would be a good start.. Better than BASIC for sure, but only if you have some understanding IMO. Because of the syntax being indents rather than really defined delimiters for statements and structures.

liorean
01-24-2004, 12:24 PM
Mhtml: Scheme is a LISP and has the syntactical intuitivity of a general LISP language - it can be hard to read and understand for a beginner. On the other hand it is a language with very few rules, and zero exceptions to those rules. It's hard to read especially since it uses prefix instead of infix notation - the same thing that makes operator priority orders unneccesary in Scheme, and thus removes one of the rules that you have to take into account in other languages. Let me give you an example:

JavaScript:
var
n = (2 + 5 + 7 + 5) * 3 / (11 - 7) * 2;
Scheme:
(define n
(*
(/
(*
(+ 3 5 7 5)
3)
(- 11 7))
2)
)BASIC has been superseeded by better languages. Why not try ABC if you want a close-to-natural language instead?

Velious: If there is a Python compiler, you can run it without installing anything. If there is not, you have to have the interpreter installed. I don't really know since I've not had that good a look at Python.

Unknown
01-24-2004, 09:36 PM
Originally posted by liorean
I think you're beginning in the wrong end. It would be better if you began with higher level programming, I think, and then worked yourself down. The binary and hex thinking will become more and more important as you get closer and closer to the machine, but the actual thinking is easier in the more advanced languages. Now I should mention that I think C/C++ to be pretty low level, and that you should probably begin with a somewhat higher level language, such as Python, Ruby, Scheme, JavaScript, ML, Haskell. Don't start with Java though - it's high level, but it's conceptually C/C++ dropping the more low-level parts, and not adding much on it's own.

In assembly, you must think of what the processor should do. You must yourself convert an idea from a conceptual plan, an algorithm or a set of algorithms, into something that the processor can handle, and you must yourself make sure that eavrything works as intended once there, and that the way back into a concretisised program that the user can interface with works. The higher level languages take care of some of that for you. The really high level languages takes care of almost everything of that for you, and you can concern yourself more with the actual task you want handled.

As I said, I think working your way top down instead of bottom up is a better choice for learning.


So your saying that any coder should start with advanced languages like Python? And if I'm not mistaken you said that JavaScript is harder than C++?!??!?!

I'm new to the coding field and I wanted to know what is the bets language to start...I know HTML and I was going to learn Visualb Basic 6 and JavaScript but found them hard.... I started reading the Teachyour self C++ in 21 days and i find it kind of easy (1 day into :) ). Any suggestions?

liorean
01-24-2004, 09:53 PM
Originally posted by Unknown
So your saying that any coder should start with advanced languages like Python? And if I'm not mistaken you said that JavaScript is harder than C++?!??!?! Not harder. More advanced, more abstracted, but I would say it is rather much easier than C/C++. C/C++ can do more than JavaScript can, but on the other hand you need to not only tell the computer to do something, but you also need to tell it how to do it. In more advanced languages you have language constructs that let you concentrate on what to do, not how to do it. But then you have another layer here - libraries. In C/C++, you have loads of libraries, and in Java you have to bewading knee deep in them to do anything at all. But JavaScript has no libraries. The host environment provides it with what features you get, and that's it. EcmaScript4/JavaScript2 will add the capability to build libraries, and then you will find that JavaScript is a language that can do most things that Java can. (It will still be interpreted instead of bytecode or machine code compiled, though.) And yes, JavaScript is far easier to learn than C/C++, because the time you need to learn how to use the different C/C++ libraries will go directly into learning the core language and the browser's host environment with JavaScript. JavaScript is a SMALL language, with a clean and pretty consistent syntax. It's not especially hard to grasp.
I'm new to the coding field and I wanted to know what is the bets language to start...I know HTML and I was going to learn Visualb Basic 6 and JavaScript but found them hard.... I started reading the Teachyour self C++ in 21 days and i find it kind of easy (1 day into :) ). Any suggestions? Hmm, I think you would find a book with the same complexity covering JavaScript to be even easier. But C/C++ is a better language to learn if you really want to go programming. However, I would recommend you Ruby or Python. They are both fairly easy to learn, they have far greater capabilities then JavaScript because of the default libraries, and they have about as clean syntax.

Unknown
01-24-2004, 11:41 PM
Thanks :)

Concerning Ruby and Python... Are they like C++ or are they internt languages?

Do you need a complier to make things out of them if they are like C++ and are the supported by all browsers or platforms?

liorean
01-25-2004, 12:06 AM
Python and Ruby are both interpreted languages, and they are only supported on systems - of any platform - with the interpreter installed. C/C++ is compiled, and is because of that instead supported on all systems, but only for the same platform as they were compiled for. Java is bytecode compiled, and only supported on systems with the Java Runtime Environment installed. VBScript is supported by iew only. JavaScript is supported by pretty much every browser. These two are the only languages you can expect a browser to support, even though PERL, Ruby, Python and others may be added to at least iew. (There's a project for adding Ruby to moz, but I don't know how far they have come yet, or whether that is as an application or document language.)

jkd
01-25-2004, 12:37 AM
Ruby and Python can be used in Mozilla for creating XPCOM objects, bridged in via the RbXPCOM and PyXPCOM projects respectively. But you cannot use them as local scripting languages on a webpage.

In Win/IE however, through the Windows Scripting Host, you can use either in place of Javascript, interestingly enough. At least Python... I'd assume Ruby too.

Unknown
01-25-2004, 04:07 AM
Someone oughta make a language that is the combination of all the good features of all the langauges out there into one simple and powerful language.... someone *cough*liorean*cough* :)

liorean
01-25-2004, 01:41 PM
Oh, but the question isn't really about making a really advanced and powerful lanugage, but it is tradeoffs. Functional style of programming is on the march forward, especially the concepts of closures and functions as values (coming together in what is now know as Higher Order Programming). Now, those features makes one type of object oriented programming obsolete in general, except for a very few features. And if you want those features? Then you need an object oriented language and need to drop a bit of what makes the functional paradigm so powerful. We have the threads and processes versus separated flows and continuations debate. We have object based versus machine close debate. We have automatic grabage collection versus full memory control. We have the event driven versus poll driven debate - especially in areas where events are a no-can-do because of technical issues. We have the dynamically versus strong typed issue. And the lexical vs. dynamic vs. static scoping. And we have the interpreted vs. byte code vs. machine code compiled issues. We have the sequential (imperative style) vs. nested (functional style) way to do things. And on top all this, we have the question of what syntax to use.

When you make a language, you have to either make a choice in one direction or the other, or drop the feature entirely. There is no way you can accomodate for each and every detail in the way that everyone will agree is the best. The ultimate language is a utopian dream, but it will never become reality.

Code Wizard
01-25-2004, 03:15 PM
Originally posted by liorean
Oh, but the question isn't really about making a really advanced and powerful lanugage, but it is tradeoffs. Functional style of programming is on the march forward, especially the concepts of closures and functions as values (coming together in what is now know as Higher Order Programming). Now, those features makes one type of object oriented programming obsolete in general, except for a very few features. And if you want those features? Then you need an object oriented language and need to drop a bit of what makes the functional paradigm so powerful. We have the threads and processes versus separated flows and continuations debate. We have object based versus machine close debate. We have automatic grabage collection versus full memory control. We have the event driven versus poll driven debate - especially in areas where events are a no-can-do because of technical issues. We have the dynamically versus strong typed issue. And the lexical vs. dynamic vs. static scoping. And we have the interpreted vs. byte code vs. machine code compiled issues. We have the sequential (imperative style) vs. nested (functional style) way to do things. And on top all this, we have the question of what syntax to use.


Couldn't of said it better myself! ;)

Mhtml
01-26-2004, 02:49 AM
I've used python as a serverside language on IIS. It tooks me hours to get it going but I did it ... I run apache now so it's probably easier on it..

Scheme looks incredibly verbose!! What things is it suited to?

Also there is a way to compile python into executables but it only works on win 2k / nt systems I think ... I can't remember. www.pygame.org had the library for it there or a link if I remember back to when I used python.. Py2Exe was it's name (I think)..

Python wasn't bad as a language, I created a few little 2d games using the pygame libs before I moved on ...

liorean
01-26-2004, 03:45 AM
What things Scheme are suited to? Well, it's got a really good mathamatical support, implementations that support the full numeric tower have support for exact and inexact numbers, fractions, and even complex numbers, as primitive datatypes. It's a LISP, so it is large in the AI world. It's the language which the DSSSL stylesheet language is built on, as well as the base language for Blizzard's (Yes, the game developer owned by Vivendi) custom language that they use for various components and almost all things that are not part of the core game. It's a functional language, the first lexically scoped LISP, and it's features are pretty much those of any LISP. In difference from Common Lisp, but alike EULISP, it's a LISP-1 system. (Functions and variables share namespaces, instead of having separate namespaces). One of it's innovations would be continuations, which it uses instead of threading. It was the first language to become an international standard. Hmm, what else? Oh, I can give you a heap of links if you wish.

<http://www.engin.umd.umich.edu/CIS/course.des/cis400/scheme/scheme.html>
<http://en.wikipedia.org/wiki/Scheme_programming_language>
<ftp://ftp.cs.utexas.edu/pub/garbage/cs345/schintro-v14/schintro_toc.html>

<http://www.cs.washington.edu/education/courses/341/99su/lectures/scheme/>
<http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html>
<http://www.scheme.com/tspl2d/>
<http://www.htdp.org/>
<http://mitpress.mit.edu/sicp/full-text/book/book.html>
<http://www.jetcafe.org/~jim/lambda.html>
<http://www-2.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/web/language-research.html>

The language specification: <http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs.html>
An implementation that even though not the best in any area is the only one with a good IDE: <http://www.drscheme.org/>
(Can't talk for Chez, though, since I haven't tested it and other sources seems to think it's really really good. In my opinion, PLT is far better than MIT, bigloo, Guile and SISC though.)

Mhtml
01-26-2004, 04:06 AM
Cool, thanks man! :)

I'll have to look into it I think, even if it's just to add another language to my every growing arsenal. I knew LISP was used a lot in AI but why? I've never programmed any AI really so I've no idea ..

liorean
01-26-2004, 04:31 AM
It's got a set of features that are really useful for AI. It's properly tail recursive. It's very dynamic. It's got very strong math support. It's got closures and lambda expressions. It's got a very clean syntax. It's memory intensive but very effective. Objects and functions are both processes. It's got macros (Meaning you can change the core language as you go.). It's dynamically typed. Continuations allow trial-and-error methodology. It's perhaps as functional as a functional language can get - even object orientation (the CLOS way) is done functionally. It's really abstract, especially the early implementations. Above all, it's recursive - more like the mother of recursion. LISP happens to be one of the oldest languages around, together with SmallTalk being one of the two first developments from FORTRAN. It's picked up a lot of goodies on the way to the current language, whether that be Scheme (about 50 pages of specification), Common Lisp (over a thousand pages of specification) or EULISP (Roughly like CL but better held together, and modular).



Hmm, talking about recursion. Here's an old LISP thingy in a JavaScript disguise: <http://codingforums.com/showthread.php?s=&threadid=29520>

It took me a fair number of days to wrap my mind through. Actually, more like months... and that being a very small bit of code, being just five lines.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum