122 lines
7.9 KiB
Plaintext
122 lines
7.9 KiB
Plaintext
|
|
Episode: 1388
|
||
|
|
Title: HPR1388: JavaScript
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1388/hpr1388.mp3
|
||
|
|
Transcribed: 2025-10-18 00:40:00
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
.
|
||
|
|
Hello everyone, my name is SIGFLOPS, SIGFLOPS and the Slobble that is, and welcome to another
|
||
|
|
issue of another episode of Hacker Public Radio.
|
||
|
|
In this episode, I'm going to be talking about JavaScript, particularly my perspective
|
||
|
|
of it.
|
||
|
|
I just started programming in JavaScript, and this is completely off the cost.
|
||
|
|
This is a straight recording without any editing.
|
||
|
|
I'm actually in the hospital right now, and it's boring and sell here.
|
||
|
|
So I'm going to record a podcast and hear how about that.
|
||
|
|
JavaScript is a language, an interpreted language, or just in time, a compiled language.
|
||
|
|
I believe it's an interpretive language to be mistaken on that, but it's an interpretive
|
||
|
|
language that is typically run on websites.
|
||
|
|
We have a JavaScript engine or a JavaScript virtual machine, as they're called, on a browser.
|
||
|
|
The information you get from the HTTP server is JavaScript, and that gets actually run and
|
||
|
|
controls the web page.
|
||
|
|
It controls the document object model of the web page.
|
||
|
|
So JavaScript controls web pages dynamically.
|
||
|
|
You can also have JavaScript on the server side through Node.js, for instance, which
|
||
|
|
is an implementation of Chrome's JavaScript virtual machine.
|
||
|
|
But I'm going to be talking specifically about it on the client side, because that's
|
||
|
|
what I'm doing.
|
||
|
|
Let's see here.
|
||
|
|
I've been partying my GUI to JavaScript for a while, and that's a while, like a few days,
|
||
|
|
and learning about it, it's a learning experience.
|
||
|
|
I really like it.
|
||
|
|
It's a concept I really like.
|
||
|
|
I'll get into the concept of JavaScript a bit later.
|
||
|
|
But JavaScript was invented in 1995 by Netscape.
|
||
|
|
I've been told it's SchemeLite.
|
||
|
|
I actually haven't used Scheme.
|
||
|
|
I believe Scheme is a list dialect that I haven't actually used.
|
||
|
|
I've heard that it's SchemeLite.
|
||
|
|
So if I have a program in Scheme, I'll know what I'm doing.
|
||
|
|
It has a C syntax, so it's very C-like, and that's very comfortable for me, since this
|
||
|
|
perspective is from a C program that's receptive.
|
||
|
|
The default variable in JavaScript is the var for variable, which is dynamically typed.
|
||
|
|
In C, the default variable is int for integer, which is statically typed, which means at the
|
||
|
|
time of declaration, memory is actually allocated on the stack, perhaps, or in the heap.
|
||
|
|
Or in the data segment, well, in the stacker, the heap pretty much, for where the actual
|
||
|
|
information is stored for a C integer.
|
||
|
|
It's a bit different for JavaScript because it's dynamically typed.
|
||
|
|
The type of variable it is gets implemented at the time of its use.
|
||
|
|
So if you have a function with the input arguments to and where, if you call that
|
||
|
|
function with a string for two, then two is interpreted as a string in the function call.
|
||
|
|
Or if you have it as a object that's interpreted as an object for a function call.
|
||
|
|
Strings and objects are very similar from my understand.
|
||
|
|
JavaScript works with objects as variables instead of integers and floating point numbers and strings and
|
||
|
|
whatnot, the primary data storage of JavaScript is the object.
|
||
|
|
Let's see here. JavaScript is an asynchronous language, which is kind of interesting and fun.
|
||
|
|
C is a synchronous language, which means one line of code is executed one after another in sequence.
|
||
|
|
And you can have a for loop in C, for instance, an infinite for loop, where you jump to the beginning of the
|
||
|
|
for loop, jump to the beginning of the for loop, jump to the beginning of the for loop to stop in between and
|
||
|
|
never get out of the for loop. Like for a game loop, for instance.
|
||
|
|
Unless the game is over, then you break out of the for loop. But there are no for loops.
|
||
|
|
There are no infinite for loops in JavaScript. Everything gets run at once.
|
||
|
|
And if you need to run other things in sequence, it's usually called back from the object that you have run.
|
||
|
|
If that makes sense, I'll get into that a bit later here.
|
||
|
|
JavaScript, you know, C can be asynchronous too, because C can have interrupts, and you can have signals,
|
||
|
|
and you can do things based on on events that are outside of the program.
|
||
|
|
So C can be asynchronous, but JavaScript is meant to be asynchronous, which I think is a bit different.
|
||
|
|
It's fun writing things for it because you know it's the right language, if that makes sense.
|
||
|
|
Like with just the asynchronous of it, and you are never waiting pretty much.
|
||
|
|
So you're never waiting. You're never waiting on a move text. There aren't any move text in JavaScript.
|
||
|
|
And so you're never waiting on a spin lock or anything like that.
|
||
|
|
You just run, and that's very good for multi-processor systems, where you utilize the most without spin locking or waiting or anything like that.
|
||
|
|
It's what's right, which is kind of fun knowing that it's the right paradigm for language.
|
||
|
|
In my opinion, it's the right paradigm for language of the future.
|
||
|
|
And it really is of the future. C is kind of, you know, it's good to know C, especially right operating systems,
|
||
|
|
or work on operating systems, or work on anything with the Linux or BSD, really.
|
||
|
|
C is a very good language to know. If you're working on embedded systems, it's a good language to know.
|
||
|
|
But a lot of the web and a lot of the information structure is based on JavaScript and these things.
|
||
|
|
JavaScript, being a web language primarily, it doesn't have to be a web language.
|
||
|
|
In addition to PHP, you can have CGI, straight C programs that run on the server side.
|
||
|
|
You can have JavaScript on the server side with Node.js.
|
||
|
|
So you have those combinational languages, plus you have the content.
|
||
|
|
What is the content style, something CSS? I forget what it stands for, but it's a language describing object variables.
|
||
|
|
Of the DOM, of the document object model, and the document object model is specified by an HTML document.
|
||
|
|
And so, like, the new world of programming is those primary languages.
|
||
|
|
And so it's exciting to get to know them.
|
||
|
|
Let's see here. Like I said, there is no infinite loop in JavaScript.
|
||
|
|
Things get executed asynchronously.
|
||
|
|
If you have a bit of code that needs to run after you've done something, like open a file or something like that,
|
||
|
|
you have to be run as a callback from the object that calls that does the thing before, if that makes sense.
|
||
|
|
Let's see here. What else?
|
||
|
|
You know, I think that's all. I really have to say it's new.
|
||
|
|
The JavaScript is very exciting.
|
||
|
|
And it's the right thing to do for multi-processing systems, in my opinion.
|
||
|
|
It's asynchronous. The default variable is there, which is dynamic.
|
||
|
|
You deal with objects.
|
||
|
|
The only object is kind of funny because there aren't any, you don't have any pointers to things.
|
||
|
|
If you have their A and their B equals five, and then A equals B, A will be five.
|
||
|
|
But if you change B, A will still be five.
|
||
|
|
Because you copy the data. You don't reference it, like you do in C.
|
||
|
|
You don't have pointers and whatnot.
|
||
|
|
So that's a little hard to get your head over, but it's pointless.
|
||
|
|
So it's a high-level language, higher than C.
|
||
|
|
It's not close to the machine, pointers, being very close to the machine,
|
||
|
|
being actual memory positions, and addresses, and references, and whatnot.
|
||
|
|
There's none of that in JavaScript, because there isn't any room for it.
|
||
|
|
And let's see here.
|
||
|
|
I think that's all I have to say about JavaScript.
|
||
|
|
So thank you for listening, everyone. Take care.
|
||
|
|
And I'll get out of the hospital soon.
|
||
|
|
Bye-bye.
|
||
|
|
You have been listening to Hacker Public Radio, where Hacker Public Radio does our.
|
||
|
|
We are a community podcast network that releases shows every weekday and Monday through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by a HBR listener like yourself.
|
||
|
|
If you ever consider recording a podcast, then visit our website to find out how easy it really is.
|
||
|
|
Hacker Public Radio was founded by the Digital Dark Pound and the Infonomicom Computer Club.
|
||
|
|
HBR is funded by the Binary Revolution at binref.com.
|
||
|
|
All binref projects are proudly sponsored by LUNAR pages.
|
||
|
|
From shared hosting to custom private clouds, go to LUNAR pages.com for all your hosting needs.
|
||
|
|
Unless otherwise stasis, today's show is released under a Creative Commons,
|
||
|
|
a Tribute Show, share a like, lead us our lives.
|