last day (16 days later) » 

18:16
Hello? :o This is my first time using this chatroom
well, pretty much like any chat app
the comment section was beginning to devolve into a long series, sometimes this is a better way. Do you feel you've got your question answered?
It also seemed like we had some terms that weren't in common understanding, this is sometimes a better way to straighten that out as well
I understand the concept that the .class file is a byte file that can be read in a special type of editor. It was just difficult to process because writing a parser was very difficult for me and that was using readable symbols and words. I can't imagine trying to read machine bytes
I will apologize for SO; it seems to me the technical folk, at least in the Java area, look down on questions they consider to be fundamental.
Well, I don't call what the JVM does with a class file "parsing".
When I was studying compilers, parsing referred to taking apart text in order to arrive at something lower level -- bytecode, machine code, perhaps direct execution (for an interpreted language)
So the JVM (or whatever) reads bytes -- 16 bits? 32? I don't even know, haven't dealt with bytecode binary much. That's a number; it looks up the number in a table to see what subprogram it's going to execute because of that bytecode. I don't think of any of that as 'parsing'.
A CPU does it in hardware (or hardware and firmware, or hardware and microcode).
A JVM is a little higher level than that.
Does that make any more sense?
Okay that part does make sense, yes. But the people who wrote the JVM would need to map bytes to instructions to execute. Is there any resource to learn how to read bytes from a file like that?
Well, reading text from a file is thought of as higher level than reading binary files.
I suppose you could find a tutorial somewhere on reading binary files.
Mostly file systems allow you to read 1 or more bytes at a time; the program has to know how many go together to make up something meaningful.
18:26
Thank you so much for your help! That makes alot more sense now. It does make sense that the JVM would execute a low level machine code instead of ascii-text which would be slower
MUCH slower.
Also much more compute-intensive.
Java was originally invented to be used in kitchen appliances -- in the early 90s
So the real question is, learning how to generate a bytecode file. I'm trying to write a compiler that targets the JVM
They did not expect to have much of a processor in a refrigerator or dishwasher, but they did want to be able to update it without having to download a lot of bytes, and to write things for different processors without different compilers
ok.
Different language, same virtual machine, then?
Yeah exactly. It'll be a tiny language with minimal instructions. It's mainly for learning code generation (back end)
I'm good with the front end compilation, that part is easy
Hmmm. Is this a class project or a personal one?
18:29
lexing, parsing etc. It's eventually for my college thesis.
Ah. Are you allowed to use the tools available for the purpose? In my day it was lex and yacc ...
I suppose I can :o But again, lexing and parsing are the easy steps for me. It's the actual generation of machine code/machine-bytecode
that's the hard part I'm trying to figure out how people do
I see. Unfortunately, it's one of the parts I know least about.
No no that's okay! You've been amazing. I hope this is not inappropriate to ask but, would you like to stay in touch? I know we don't know eachother, but you've been so helpful and I feel like it would be enjoyable to have discussions with you
Perfectly okay if not though
I do know that the JVM Bytecode is going to be slightly more complicated than the equivalent machine code; some of the bytecodes do a great deal more stuff than any machine code does.
I'd be happy to keep in touch.
My name is Ralph; I'm a retired computer programmer in NC, US.
I have a Master's in Comp Sci that I completed in 1985, hence the disclaimers of the age of my knowledge of this sort of thing;
18:32
Thank you! I'm Lauren, a computer science major from Canada.
have hardly dealt with compilers since, though I did write a cross-assembler in my first programming job!
What city in Canada, just out of curiosity?
A cross-assembler? :o
Are you asking what that is, or just surprised?
Asking what is its haha, sorry.
It was 1977 -- I had a Physics degree, had taken one programming course (in PL/I) and one digital logic course, was teaching myself to hand-code microprocessors which had few translators available.
18:34
That sounds incredibly complex. I'm grateful for abstractions
We used the Zilog Z80 as a larger computer, running CP/M, an operating system available for mostly hobbists
And we used Fairchild's F8 for signal processing; my digital eng boss liked the way it did I/O.
We were hand-coding the F8 -- there was no development environment or translator at all.
we wrote out the code on paper, then used a little index card with the instructions to translate that to hex
Then we keyed the hex into the machine, one hex digit at a time.
Is this a specialized computer that didn't use an OS?
Well, yes, I guess that is what it was.
The F8 was targeted at console video games
May I ask what an index card is?
It had 64 scratchpad registers to try to avoid having to have any memory.
Oh, just a 3x5 inch card
with tiny print -- it could have been a piece of paper, but the card stock was sturdier.
After a few months of that, and after I stopped my Physics graduate study to go with programming full-time, I told my boss I wanted to write an assembler for the F8 using the Z80's development environment.
It had an assembler, and editor, and used floppy disks -- 5 1/4", stored 90K
So that's what I did. Then we wrote a program that would load the F8 code into the F8 from the Z80, and we never hand-coded anything again
18:39
Woah. So the F8 is a computer you were writing programs for. But now you wanted to write an assembler that'll translate to the hex instructions of the program
Exactly
The assembler itself would have to be written in hex directly, but anything above that was pretty much an abstraction
I did NOT know what I was getting into, or really even what I was doing.
No, I wrote the F8 assembler in Z80 assembler language
That's the 'cross' part of 'cross-assembler' -- we never assembled on the F8 itself.
Fortunately all the stuff about regular expressions, etc., is not really necessary for an assembler.
No need for look-ahead left-right parsers -- LOL
Hahaha, it sounds really interesting how it went from hard coding hex instructions
to assembly
I built a symbol table that stored its symbols in the order defined, and searched it linearly
18:42
When you hard coded hex instructions, were you essentially coding RAM manually?
Yes, pretty much.
There was a 1K read-only memory chip that had control of our CPU board when booted up. It communicated over serial with a console.
You could enter a command that would allow you to enter hex values to store in memory
So that's how we got them into the machine before my cross-assembler.
My boss was impressed.
I hadn't even been programming 6 months at that point
Were there such things as executables?
well, we normally use that to refer to files
We had files on the Z80, and executable files on the Z80 floppies.
All we had on the F8 was records of memory we could put on punched tape
At least, before I wrote the driver for the microcassette recorder we bought
Ahhh, sorrry can I ask a question related to that? Sorry, don't know if you're busy and I'm keeping you
Gosh, you've gotten an old man rambling on about his past -- sure, go ahead
I'm retired... 8>)
afk for just a minute, gonna get a soft drink
18:48
Haha, it's very interesting! All these abstractions that people take for granted
Someone had to do it
Very true. It gave me an interesting perspective on programming that has served me well ever since.
None of it is magic -- it's all ones and zeroes at the end
I went back for the Master's to see what academia had to say about it -- that was interesting also, though the University didn't have much use for me
I would honestly learn so much from you. I'd be ever so grateful if we could be friends. You're very enjoyable to discuss with.
Well that's flattering, thank you.
email is r cook at pobox dot com, with appropriate symbols and no spaces...
Do you think I should do a Masters when I graduate comp sci? I just finishe my 2nd year and I've got 2 more to go.
Depends on what you want to do, and please keep in mind that my knowledge of this is very old.
It seems to me that many academics, certainly at the school where I went, looked down on programming the same way architects might look down on carpenters (if the architects are snooty, that is)
18:52
No no, I understand. If I may ask, when you said you wrote a driver. So I'm guessing the job of a driver is to interface different pieces of hardware?
And yeah I know that feeling
Yes -- 'driver' may not mean the same in my use as it usually means today
A modern operating system uses drivers to interface with specific hardware, and the OS imposes restrictions on its drivers so they can mesh with the rest of the OS
Since drivers have to do low-level stuff, and sometimes real-time stuff, their requirements are different than normal programs.
They also have to get used by programs on the machine, sometimes several at once.
Do drivers run on top of the OS? Or alongside? That question might make no sense, I apologize if that's the case
I guess what I really wrote was a library; one could write a program that used my code to do reads and writes from/to the cassette deck without having to know how the deck worked.
No, the question makes sense, maybe even more than one sense. Let me see...
I guess we can think of an OS as an abstraction of the hardware on which it runs.
You apply power to the machine, and (these days) you get a screen background and some icons and you can move the mouse cursor with the mouse and type on the keyboard to enter text, etc.
At some place in the OS, there is the concept of "the user's mouse".
But it might be USB, or BlueTooth, or some other interface; you still want the user's mouse to do the same things and cause the same OS actions.
So a driver, on one side, interacts with the hardware signals -- knows when it's moving, when it is clicked, etc.
On the other side, it is communicating with the OS, saying "current position is X,Y" "left mouse button pressed", "left mouse button released", etc.
The OS defines how the driver communicates to the OS about the actions the OS supports for the user's mouse.
So if someone comes up with a new interface for the mouse, they can write a new driver, and no one has to mess with the code the OS has for interacting with it otherwise.
So is that on top of the OS? I'm not sure...
In one way it is, in another it's sort of under the OS
Oh, no! I've put her to sleep! 8>)
onononoon
I had to answer the phone, forgive me
NP
I figured that or some other interrupt -- no apology necessary
The phone or doorbell rings, your roommate/boyfriend/mother calls from another room, who knows?
I find more humor in most things than most people do -- gets me in more trouble...
19:05
haha, girlfriend actually. That might've not been as common for you back then.
I just thought it was a good joke after all that typing
Well, not publicly anyway
The young women I knew would mention their girlfriend(s), it was understood to mean (platonic) friends of theirs who were female
What you wrote makes a ton of sense. I feel like programmers these days take alot for granted, and the moment something goes wrong, they're often stuck
yes -- that was true even then!
Really? :o
I was appalled by how many things the hotshots in the CS department just copied from somewhere else, had no idea how they worked and didn't care.
I've long had an interest in software engineering -- I think the industry has done a terrible job at making programming an engineering discipline, and I was interested in how to further that.
Unfortunately I was swimming upstream all those decades -- a lot of it is still in terrible shape.
19:08
Programming IS an engineering discipline. I'm really surprised programmers and computer scientists aren't asked to take an ethics oath/exam after graduating
We can cause alot of damage..
More damage than any other engineering discipline.
But CS people, as near as I can tell, don't like to do engineering-type things
Neither do programmers, if you regard them as separate.
Well it's like I said. Alot of programmers are comfortable in the highest level of abstractions. Using cushy frameworks and such
Which is fine for productivity, but it can be a double edge sword
If they want, or had wanted, to improve the engineering, they need(ed) to study further how long it took to do things, where the errors came from and how to eliminate them, etc.
hee hee -- 'productivity' is one of the more interesting words in the field.
I submit that, when most people in programming talk about "productivity", what they mean is the amount of code that can be written per unit time.
Can I ask for some advice? I know you're retired now, but anything you offer would be helpful
My advice is free, and worth every penny -- shoot.
19:12
I often see job postings for Java developers and Python developers and whatnot. I'm looking to try to get a job while studying but it would be my first ever developer job and I have no idea what to expect
Do they need you to know the entire language? Every tiny detail? every framework?
All of the above/
?
Not in my experience.
What's worse, they don't even necessarily expect you to know all the things they list in the job description. How much of it they expect is a crapshoot, if you know that expression.
Yeah like, I know an array of languages from C to C++ to Java to Python, but I wouldn't say I'm incredibly advanced in any of them if that makes sense
I would recommend looking for something where the problem domain interests you -- are they writing things for pizza parlor ordering, railroad maintenance, weather modeling? that sort of thing
Like if someone came up to me and asked me to create AutoCad, I'd need to do alot of research
hee hee -- if someone asked an undergrad to do that, I'd look elsewhere
19:15
When I first looked at C, I was really intimidated
But I can see how powerful it is now, it feels amazing
Once you find something that is of any interest to you -- doesn't have to be a lifelong thing, just enough to pique your interest, then try to determine as best you can what the job actually entails. Are they writing a new system? maintaining an old one? Is it user interface code? database access code?
If any of that sounds compatible with you, apply -- at the interview, any job worth having will ask you if you have questions. I'd prepare a few about the programming environment, i.e., what is it you will be doing?
Thank you so much for that info. What in your opinion would tell companies that you're a valuable asset? Again, I know, if it's too specific a question, I apologize.
You don't have to be that explicit about it, or you can be, or you can judge whether to be once you've talked with the interviewer some.
I think an interest in what they're doing, on top of competence in how they're doing it.
If they're interviewing an undergraduate, hopefully they have enough experience with different levels of worker to have realistic expectations of what an undergrad is liable to have done and not done.
If it's a Python job, then they reasonably expect you to know it's interpreted, what the syntax is like, and what the common tools are.
There's that thing I don't remember the name of that you can run and then just enter Python statements into to execute immediately -- they should expect you to be familiar with that.
That does make sense. And I think you mean the python shell program
Which is just a console app I think
If it's a Java job, they should ask you things like the difference between a class and an object, and what a map is -- that's reasonable.
If it's a UI job and you have Swing on your resume, you should know what a JFrame is, and be able to explain it.
You should be familiar with ONE of the development environments -- eclipse or intellij or something
I think they should be satisfied if you've used any of them, and not restrict people to the ones they use, but some might.
19:21
Java Swing was something that intruiged me for a while. I didn't know if the JVM itself wa drawing the GUI or if it was asking the OS to
Interesting story behind that, actually.
The original UI library in Java was AWT - abstract windows toolkit
Ooh yes. Swing still uses the Component class which is part of AWT
It depended on native elements, i.e., it transferred control as soon as it could to something in the native OS library -- button, text, etc.
It was slow, it was clunky to use, and the different OSs were different enough that it was hard for AWT to be consistent.
So they wrote Swing, which essentially gets a canvas from the OS and then draws its own buttons and text areas and so forth.
Ooh, I'd imagine it would look and feel different
on each OS
Well, looking diff was part of the point
they wanted the Java program to have the look & feel from the OS
Anyway, the thing I find the most amusing about Swing is that, once they detached themselves from the native elements, it ran FASTER
19:25
Haha, almost like the OS wasn't good at drawing GUI elements
The AWT runtime and the OS code had to do so much back-and-forth futzing that it slowed things down -- and Java, at the time, had a reputation for being too slow to be usable.
Anyway, I like Swing.
Something that served me well the only times I did it --
I've used Swing a bit. Though something does confuse me.
what's that?
Do different Java editions lack features in the language? Like you probably can't use the swing package in an android app
No, you can't. Android is not technically real Java, as I understand it
It uses the language, but maybe not the bytecode? I'm not sure
19:28
No worries, it's a good thing for me to research later. I really appreciate all the knowledge you've been sharing.
I hope I haven't kept you from your wife or kids haha
But yes, different editions have different features.
Well, one kid, and she's older than you -- now a lawyer, living in Chicago.
Oh wow! That's amazing!
Married to a man from Canada, actually -- he grew up in Saskatchewan
born in China
Well look at that. Small world.
hee hee - BIG country
Oh, was going to say -- consider taking a program that you've written for yourself to your interview with you
Nothing you've done for someone else, unless you are POSITIVE there is no intellectual property issue, and nothing, of course, that you can't leave with them.
19:30
Should I take my entire portfolio?
I keep my programs I write organized pretty well
Well, careful with that -- I wouldn't want to give them the impression that I expected them to look at the whole t hing.
I wrote a program to analyze disk space
it graphs the amount of space taken by a given directory subtree, and allows the user to expand each subtree level to see what IT's taking up, etc.
That gave me a chance to show them my own organization of code, et.c
I'm surprised more companies don't ask for this.
But in 40 years I haven't been asked more than once or twice
Oh wow, it shows a good knowledge of data structures too
I have been expected to write a program on a whiteboard during an interview...
Oh wow, what about/
I don't remember now, but they gave me a problem to solve, and one of the things they were looking for was recognizing that recursion helped solve the problem, and how I programmed that.
In C, which I hadn't used in over a decade at that point.
Fortunately Java syntax is very similar
Well, have a suggestion ---
19:35
Oh? Do tell
If you want to stay in touch by email, why don't you send a test email to my address now
that will confirm that you have it, and give me a return address for you
Do you happen to frequent Google hangouts?
or Google Chat, or whatever they're calling it now?
Sure thing! I'm just trying to change while texting. Not the brightest idea I've had
hang on I'll send my email
Another thing or two that occurs to me about jobs...
It is unusual to find a job where you are writing new code for something.
19:38
Oh that makes sense. You basically maintain old cold
Most jobs are maintaining existing code -- probably trying to fix something, or add a feature
So practice in (and willingness to) dig into a pile of old, less-organized-than-yours code is a plus
There will be conventions at any shop -- I've not been in one that didn't have them.
Java carries many of its own, of course
Well I've been scouring the Java Class Libraries (the ones that come with the language) as well as the C standard lib
Python tried to codify some, but they don't seem to be used as universally as Java's are
which is thousands of lines of old code
Does that count haha
It counts, but that code is almost certainly better organized than the code you'll find in most shops
ok, just sent you an email
You didn't answer about google chat
19:42
I did I sent my email
Do drivers run on top of the OS?
wait it didn't paste
properly
There we go
The amy cup cake email? that's where I sent it
Ahh one second, let me check
and I mistyped it - hang on
forgot the 77
I also have [email protected], but the other address forwards to that.
But that's the one on Google Chat, if you care to look for me there.
No worries! And sure one sec
i sent an invite
Ok, I have your return email
Gosh, I haven't dealt with a chat invite in so long I've forgotten how...
19:46
Haha, no worries! It might be a notification on the side of your gmail

last day (16 days later) »