[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]

λ - programming

/lam/bda /lam/bda duck
Name
Email
Subject
Comment
File
Password (For file deletion.)

BUY LAINCHAN STICKERS HERE

STREAM » LainTV « STREAM

[Return][Go to bottom]

File: 1428312304793.png (10.03 KB, 1052x1052, JavaScript-logo.png) ImgOps iqdb

 No.5415

fuarrrk javascript.
>>

 No.5416

File: 1428313663588.jpg (55.53 KB, 625x477, first_result_in_image_sear….jpg) ImgOps Exif iqdb

>>5415
Is there something better to use as a replacement?
What are things like ruby, dart and python like as an alternative?

>>

 No.5417

File: 1428315364284.jpg (474.35 KB, 1024x612, javascript.jpg) ImgOps Exif iqdb


>>

 No.5418

why? what happen

>>

 No.5419

Running unauthorized code on your machine is something no one should do. Install noscript!

>>

 No.5420

>>5415
Nice thread, fggt.

>>5416
There's no alternative for client-side web scripting. There are some dialects for popular languages with JS as target, as well as Emscripten, but it's still just JS underneath.

See also https://tcr.github.io/langlangmatrix/

>>

 No.5421

>>5419
Is it even possible to use any website anymore with stupid soykaf like noscript installed?

May as well just install noHTML while you're at it.

>>

 No.5422

>>5421
definitely! remember that JS used to be absolute bullsoykaf and only got more or less usable very recently.

theoretically, it would be good practice to have a fallback for ALL the javascript functionality, and some websites do i think, e.g. amazon (i didn't test that), duckduckgo and reddit definitely do, and this place here course.

however, many websites are actually not websites but javascript applications so they won't work without it.

one example that annoys me particularily is tumblr, i liked browsing it sometimes, and i wanted to download some timelines with wget but the stupid javascript endless scroll/HURR PLEASE SIGN IN soykaf got in the way.

im looking at it right now and these assholes can't even be bothered to display a "please turn on javascript because nothing works" message on the empty page. fuarrrking yahoo.

>>

 No.5423

>>5415
i like javascript, maybe i can help?

>>5416
also yes, dart compiles to js so you can use it

>ruby

>python
you program web server logic in those, not code that gets sent to the browser. i'm sure there is way to transcribe those to javascript too because there is way to compile EVERYTHING to javascript and add types and whatnot, but few people would use such a thing for their website.

>>

 No.5425

>>5421
> Is it even possible to use any website anymore with stupid soykaf like noscript installed?
Yes. And some sites are better viewed that way.
I installed it when some idiotic corporate website's JS-based bells and whistles made my Core i5 behave like Pentium 4.

>>

 No.5426

>my personal blog

>>

 No.5427

I recommend Biwascheme.

http://www.biwascheme.org/

Makes JS a lot funner once you get it going.

>>

 No.5432

>>5421
>>5422
I can confirm Amazon works fine without javascript.

Javascript seems like a good design with a bad application. It's incredibly easy to bang something together and get it working. But it's really bad from a security perspective. Good security practice means not running code or binaries unless you're fairly certain it's not malicious.

When you browse from url to url on a web browser, and you have javascript enabled, you run code every time you hit a new web page.

Of course a malicious js script wouldn't have access to your computer's bits like a shell script would, but still. The idea of heedlessly trusting website operators with clientside code makes my skin crawl a bit.

>>

 No.5433

>>5415
the op doesnt list the posts that have replied to it.

>>

 No.5434

I agree

>>

 No.5438

>>5433
>>>/q/
>>>github.com/lainchan/lainchan/issues

>>

 No.5446

>>5421
Some web pages don't. If I want to use the webpage I'll enable javascript for that page. Javascript does not get any less soykafty just because some pages require it.

Installing noscript and refcontrol made me realize how much extra soykaf is loaded by the web browser from 1 million unknown webpages unrelated to what you're really viewing.

>>

 No.5448

>>5446
yeah. news sites are slamming tons of 3rd party bullsoykaf tracking/ad js scripts into their sites which SUCKS and has to stop right fuarrrking now.

there is a billion browser plugins to disable that crap, it's what adblockers primarily do, but you can also use fancier solutions, e.g. http switchboard for chromium. (need a firefox port of that by the way)

the problem is that the browser's JS APIs have become to powerful, so you can easily de-anonymize users using javascript, even if the user's ip adress is proxied and his browser does not accept cookies or localstorage[0].

[0] a localstorage entry is basically a less secure cookie that can be set from JS and has no expiration date

>>

 No.5449

i forgot to explain this
>de-anonymize users using javascript

you do it with browsers fingerprinting… user agent string, screen resolution, supported media codecs, installed plugins, all that stuff the browser can be asked in jS adds up to lots of bytes of information

>>

 No.5478

>>5448
Not limited to JS actually. There are also these annoying little 1x1 things – web bugs. News sites have them a-plenty.

>>

 No.5482

>>5478
that is correct, but when you talk about the tracking pixels you also have to mention flash cookies and silverlight cookies.

>>

 No.5485

>>5482
> silverlight cookies
Never heard about these ones (since I've never had Silverlight installed in the first place), where are they located?

>>

 No.5486

>>5485
i have no idea except for the fact that you can store things in silverlight

>>

 No.5496

>>5448

localStorage is stored for the subdomain.

Use incognito/or ctrl+shift+r and it's like it doesn't exist.

>>

 No.5557

>>5432
>Amazon works without javascript
I retract this, I could add stuff to my cart but couldn't place an order without allowing javascript to run from two domains.

>>

 No.5594

This board has a quite cool colourscheme today.
nb, OT & useless

>>

 No.5752


>>

 No.5761

I don't like the overuse of javascript, especially cross-site libraries that get used just because they're linked from some website development it or whatever.

But so far I've had a fine time trying to use it as a language for simple game development: Running Windows, I don't need to worry about getting an IDE or package manager for it, canvas functions are very simple to use, and distribution is as simple as putting it up on a website. For working on my own it's very nice to have.

>>

 No.5814

probably not the best place to ask but does anyones have any recommendations of websites/books to learn JS from?

>>

 No.5815

>>5814
http://eloquentjavascript.net/
JavaScript- The Good Parts

If you have previous programming background, these two will be enough.

>>

 No.5819

>>5422
>these assholes can't even be bothered to display a "please turn on javascript because nothing works"

This makes me more upset than it should.

Might be off-topic, but I really wish the web was mostly text-based, or at least that a text-only browser would be able to get most of the web. All these fancy sites that are made to look attractive to the average consumer just spread information over too much space.

>>

 No.5930

>>5819
Lynx still works and works quite good. My 'most of the web' is generally text though. And occasional video fed to youtube-dl (or vlc).

Why lynx? Extremely soykafty internet connection, that's why.

>>

 No.5932

>>5819
>This makes me more upset than it should.
I totally agree. I don't enable Javascript in my browser out of security concerns.

The world looks at me as paranoid but I think everyone else is crazy. Why would you want every random website you visit to run arbitrary code on your computer? Especially in a world where browser vendors are fighting to be the the with the most features and the fastest rendering engines and no one cares about the security of it all.
http://h30499.www3.hp.com/t5/HP-Security-Research-Blog/Pwn2Own-2015-Day-Two-results/ba-p/6722884

Javascript also makes it difficult for automated programs to process websites.
http://tantek.com/2015/069/t1/js-dr-javascript-required-dead

>>5930
I feel your pain. I was once stuck without a broadband connection for a while. Doing everything over 3G quickly made me realize how valuable text based browser are.

They are also good for work. When people look at your screen it's just another terminal window, right?

>>

 No.5934

I'm do web development for fun. Most times I try to use the templating system Express/Catalyst/Flask/Sinatra gives me, but there's some kind of websites that REQUIRE javascript, like things with realtime data.
I understand that most sites don't need it, but I really don't like to see people hating realtime websites. They are great.

>>

 No.5948

>>5932
It's not pain, if you are speaking about browsing. A mild nuisance but nothing above that.
Getting updates is where the pain starts but even then, get to the town centre, nick someone's wi-fi, get updates, piss off.

> They are also good for work. When people look at your screen it's just another terminal window, right?

Haha, aye, but (a) I don't work in IT; (b) I would rather not use my personal computer for work.

>>

 No.5952

>>5948
If you're on someone's wifi and you start seeing upside down cat pictures then this is why.
http://www.ex-parrot.com/pete/upside-down-ternet.html

>>

 No.5969

>>5815
>JavaScript- The Good Parts
thanks. this was really good.

>>

 No.5982

>>5952
All I see is fnords.

>>

 No.5983

>>5948
It's a shame you appear to be from up north. We could have gone hacking wifi networks together.

>>

 No.6088

>>5983
But what if I am a rozzer?

>>

 No.8000

I wonder if Web assembly is going to be a net good or not.

On one hand, it will probably largely kill JS and the need to compile to it.

On the other hand, it will only make things harder for smaller browsers, which is already an issue since web browsers are evolved instead of designed.

Needing large companies to develop a fuarrrking web browser is ridiculous.

>>

 No.8002

>>8000
Nice get. The port people usually use when testing webapps.

Right now, it would be much simpler to just redesign the whole web from scratch and include a non-soykafty scripting language. I wonder if someone has already tried this.

>>

 No.8003

>not liking javascript

Why? Just tell me why?

>>

 No.8006

>>8003
It's seen as a "necessary evil" by epic webdevs when it isn't necessary at all.

>>

 No.8008

>>8002
How would you make a non-soykafty web scripting language? Javascripts pretty good for what it's made for, but people try using it to make apps which is not the point of a browser.

>>

 No.8010

>>8008
Isn't lua already perfect for that?

>>

 No.8032

>>8008
Same thing with html.

>>

 No.8036

>>5419
>install noscript

you're joking right? why would anyone sane install noscript?

>>

 No.8037

>>8036
Yeah, it's crazy! My granny installed noscript, and then she started running a gang. She still runs it, even now. She's the gang leader in Present Day, Present Time! AHAHAHAHAHA!

>>

 No.8041

Exploit mitigation comes to mind. Ressource control would be another point.

>>

 No.8044

>>5421
>>8036
The only websites I whitelisted scripts on are
- startpage
- lainchan
- 8chan
- amazon
- digikey and a few other parts suppliers
- youtube
There aren't any other sites I use regularly enough to need scripts enabled. So I opted to not have remote code executed automatically by my browser.

If you get past the disgusting formatting, by the way, most news sites work without javascript, and the ones that don't are usually really soykafty.

>>

 No.8049

>>8036
It's not uncommon in communities like this. I use it myself.

>>

 No.8050

umatrix > noscript imho

>>

 No.8131

>>8044
Interestingly enough, with NoScript startpage works even if scripts are not allowed. B
ut should you try to access it in a uMatrix-powered browser, you'll have to allow JS e
xecution.

Same for *.wikia.com. JS is needed to display some images if you are using uMatrix. Wi
th NoScript it works without any additional movements performed.

>>

 No.8132

>>8131
soykaf. Something has broken the formatting.

>>

 No.8155

>>8010
It's nearly there, but it has the soykaftiest regex implementation i've ever seen.

>>

 No.8273

>>8155
Is regular expressions something that's typically needed for client site web programming?

>>

 No.8277

>>8273
Yes.
Painless user input parsing is key in front end stuff. You're more likely to encounter it there than in server side code where the data is structured.

>>

 No.8462

>>8044
I have a tampermonkey script from greasyfork that getsrid of unneccessarry js on youtube

>>

 No.8483

Why is AngularJS so in demand now? Should I actually learn it properly or is it some meme-tier framework of the year in which case I can just skim few tutorials and somewhat truthfully claim on job application that I'm a goddamn elite?

I'm not webdev but damn it's in demand. Kinda like RoR few years back before everyone moved to Django and Flask seemingly overnight.

>>

 No.8487

>be grizzled C++ veteran
>hate the trendy webdev assholes i encounter on a daily basis
>need to build a website for some reason
>remember vaguely my old courses about PHP and JS
>try PHP
>PHP is soykaf (duh)
>decide to learn what all the fuss is about node
>research that soykaf
>learn about express
>url routing is robust as fuarrrk and meaningful
>the templating engine (Jade) blows every single line of soykafty view code i've seen out of the water
>JS itself is way easier to work with than the piece of soykaf i remember
>suddenly i feel like i'm writing Lisp
>epiphany ensues
>Crackford was right, JS is Lisp in C's clothing
>start treating my code like Lisp
>be modular and functionnal as fuarrrk
>finally enjoy coding in the dreaded language that was designed in a single week
It's nice to be wrong sometimes.

I might even start writing my occasionnal python scripts in JS because i actually appreciate working with it.
Eh, it still has a ton of flaws but i'm baffled that i actually even like working with it.

>>

 No.8492

>>8487
>suddenly i feel like i'm writing Lisp
>Crackford was right, JS is Lisp in C's clothing
Good one.

>>

 No.8503

>>8277
Anon, I hope you're re-doing that input validation on the server side. You can't trust the client to send valid input, even if you validate it for convenience sake client side one must still validate everything on the server side too.

Sage because this is obvious to everyone (except entry level PHP devs, it seems).

>>

 No.8517

File: 1439536996907.pdf (1.48 MB, JavaScript_ The Good Parts.pdf)

>>8492
I wasn't really convinced either the first time around.

But if you get beyond the syntax and its quirks and into what actually makes the language, you got a language with first class functions, a type system that isn't based on class (Marx would be proud) and very weak typing.

File related, it's where the quote is from (though i know not of the original source) and it makes somewhat of a case for it.

>>

 No.8518

File: 1439538764580.webm (7.56 MB, 861x646, wat.webm) ImgOps iqdb

>>8517
I really don't like Javascript's prototype inheritance system... so I don't use it.


function MyFunc( arg0, arg1 ){
var self = this; // because "this" is like kicking dead whales down the beach in JS.
self.inheritFrom = OtherFunc;
self.inheritFrom();
self.memberVar = 42;
function privateFunc(){
/*...*/
}
self.memberFunc = function(){ /*...*/ };
}


A faux "subclass" can assign a "parent's" inheritFrom property to itself then calls it as the parent constructor which creates the other features.

Interestingly, this isn't only faster to type in my benchmarks this style can be faster since the interpretor will find the property on the function without having to walk up to the prototype to get a reference.

The way "this" works in JS is nutty, IMO. It seems to be at odds with how closures work in that if you take a function property from one object/function and assign it to another then the "this" in that function becomes the object it's assigned to when called. The "self" pattern above allows one to reference the original instantiating object (like a "this" that obeys closure scoping).

Also, vid related.

Nowadays I use JS very little, to interface with the DOM / audio / graphics systems and do all my browser side coding in ASM.js. It's much faster has no GC bullsoykaf (which one rarely needs anyway since event driven execution lends itself to procedural or functional programming models). I'm so glad that all the browser vendors are on board with Web Assembly, which will FINALLY give us a low level bytecode and allow us to not be chained to the bullsoykaf JS language -- Or, more correctly: We can already compile other languages down to Asm.js/Web Asm (which Firefox turns into [mostly] machine code). However we still have to make calls out of the ASM.js to interact with browser features. Web Assembly will eventually allow us to bind directly to those features and remove JS from the loop altogether. That means we'll be able to write code in any language and not need to screw with trans-language calling semantics or other such inefficiencies.

Who cares if JS is "Lisp in C's clothing" (the worst of both worlds) when you can just use Lisp or C itself right in the browser instead?

Unfortunately Sun dropped the ball with Java which was going to be the web application language with Applets. Javascript was just to do light weight glue between the DOM and Applets, hence the name. If Sun had made Applets a lean mean browser embedded VM rather than drag a full featured everything-and-the-kitchen-sink API into the web (along with the huge attack surface and load time that represents) -- If they had made Applets like J2ME -- Then we'd ALREADY have a bytecode language for the web with JIT compliation, etc.

Par for the course with moronic web crap, we'll get the feature smart people know we need eventually but we'll go about it so backasswards that it'll be chock full of complexity (and vulns) rather than designing things correctly from the outset.

Not that I like Java as a language either or their stack based VM (register based VMs are superior since they better match the hardware); However, I can compile C or Lisp or C++ or any other language down into JVM or Web Assembly or Perl Parrot bytecode. Having a choice beats the pants off of "we use JS not because it's good, but because it's there".

I'm already doing next to none of my webdev in JS, and JS's role will only diminish in the future. Hurray!

>>

 No.8519

>>8518
>wat.webm
>mfw i know what it is without even looking
I still lose it at the noncommutative addition.

Also yeah, "this" is fuarrrking retarded and i thank the Emprah every day for the blessing of ASM.js and emscripten.
Being able to write web soykaf in any and all languages is and will be awesome.

Choice is awesome.

Yet I would like for JS to fix as much of its oddities as possible, if ECMA doesn't fuarrrk it up (again ) it's salvagable into a decent scripting language.

>>

 No.8520

>>8517
>But if you get beyond the syntax and its quirks and into what actually makes the language,
We have already deviated from a well designed Lisp, such as Common Lisp, that has few quirks and a fairly minimal syntax.
>you got a language with first class functions,
This is nice, but not solely the property of Lisp.
>a type system that isn't based on class (Marx would be proud)
Common Lisp's type system and other features are pretty integrated with CLOS. Once again, I'm not seeing how this helps make js a Lisp.
>and very weak typing.
Not one major Lisp dialect has this. I don't think any Lisp dialect has this, actually. Once again, this has nothing to do with Lisp.

You can say that js has bits of Lisp, so it's a Lisp, all you want, but that just doesn't make it true.

>>

 No.8525

>>8519
There's nothing wrong with non-commutative addition. It's just that JS is a combination of a crappy type system and semantics.

>>

 No.8536

>>8487
>suddenly i feel like i'm writing Lisp
>Crackford was right, JS is Lisp in C's clothing
>start treating my code like Lisp
Obligatory. http://journal.stuffwithstuff.com/2013/07/18/javascript-isnt-scheme/

>I might even start writing my occasionnal python scripts in JS because i actually appreciate working with it.

Or just use Lisp.

>>

 No.8538

File: 1439583809593.jpg (65.66 KB, 334x450, abstract-suffering.jpg) ImgOps Exif iqdb

>>8525
>There's nothing wrong with non-commutative addition.
muh vector space
muh rings
muh algebra

>>

 No.8540

>>8536
>that blog post
I feel like that guy is missing the point.
JS isn't literally a Lisp and it's certainly not Scheme. If anything it's closer to ELisp in that it's a bit soykaf, but you have to use it to get what you want.
The comparison is not unwarranted though, it's an influential weakly typed interpreted scripting language with quite a few dialects and a huge backing of tools and users.

I feel like that whole curfuffle is more about the place the language occupies in modern programming culture (and which is similar yet quite different from the one Lisp had) than anything else.

At this point I just wonder if Javascript's popularity will drop with all that low level vm bytecode working its way through browsers.
Only time will tell.

>>

 No.8541

>>8540
>If that’s true [JavaScript is Scheme], then C#, Lua, D, Erlang, Haskell, PHP, Scala, Go, Objective-C, Python, Ruby, and Smalltalk are basically Scheme. In other words, if JavaScript is Scheme by that criteria, then every language is Scheme, which of course means none of them are.

>>

 No.8542

>>8541
Yeah, it's not.
It just shares similarities and can therefore be compared to it.
Stay frosty anon, stay frosty.

>>

 No.8543

>>8542
Comparing /= Equating

>>

 No.8571

>>8538
Not everything is either of that. In fact, most of things don't fit into those structures.

>>

 No.8572

>>8538
>>8571
btw, algebras aren't necessarily commutative.

>>

 No.9917

So what's the best book/learning resource/ whatever for learning coffeescript + jquery?

>>

 No.9938

>>9917
coffeescript is depreciated

>>

 No.9939

Ask a German university student who gets paid 20 euro / hour to write JavaScript code anything.

>>

 No.9940

File: 1443471887253.jpg (78.66 KB, 720x479, programming in scala.jpg) ImgOps Exif iqdb

>>9939
I spent a year programming scala before that. You're free to ask about that too.

> inb4 I'm too boring

>>

 No.9942

>>9939
>>9940
How can we reverse entropy ?

>>

 No.9948

>>5421
You know that you can activate JS at any time, right ?

>>

 No.9949

>>9938
What do you mean?

>>

 No.9950

>>9939
Are you still a student / are you working part time?
If so, how did you get this position/ where are you working?

>>

 No.9951

>>9949
ES2015 aka ES6 aka whateverTheyChangeTheNameToNext has all the cool functional-programming-ish features of coffeescript without being an asinine transpiler. All the people wanking over Coffeescript have started wanking over ES6 instead, too.

Learn it if you like the syntax more I guess, just know that it's not as much of a thing as it used to be.

Also you do know some vanilla JS right?

>>

 No.9952

>>5415
Python support clientside when?

>>

 No.9953

>>9942
THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER.

>>

 No.9962

>>9952
Wait for webassembly, which will allow any programming language to be used without the need for a JS intermediate.

>>

 No.9965

>>5420
There's no lisp on that list…

>>

 No.9969

>>9962
Do we even know how WebAssembly is going to be? I have a feeling that JS will still be the thing to use for most sites, and WebAssembly will be just for complex web applications.

>>

 No.9986

>>9969
We'll never get to use it, because we still gotta support IE8 ten years from now :')

>>

 No.9991


>>

 No.10106

>>9986
m8, the point of WASM is that you can use a shim for it. old browsers will be supported gracefully, even if they run a bit slower.

>>

 No.10149

>>5416

>2015


>Elm exists

>ClojureScript exists

Feels good.

>>

 No.11657

Some people claim that WebAssembly will make things worse because you'll need to download more information to run programs.

I look forward to programming the web with Forth, I guess. The web is really awful, but Forth would make it more bearable.

>>

 No.11664

>>5819
go pher

>>

 No.11665

I'm currently studying JavaScript generators, they're a cool feature.



Delete Post [ ]
[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]