|
floatman posted:Can I use JavaScript in a PDF to expose a REST interface to access the pdf data? http://pugo.org/project/pshttpd/ it seems likely
|
# ? Feb 6, 2019 14:32 |
|
|
# ? Apr 18, 2024 23:48 |
|
gonadic io posted:http://pugo.org/project/pshttpd/ that code is surprisingly short & clean
|
# ? Feb 6, 2019 14:35 |
|
gonadic io posted:http://pugo.org/project/pshttpd/
|
# ? Feb 6, 2019 14:37 |
|
Krankenstyle posted:do not tempt the gods
|
# ? Feb 6, 2019 14:45 |
|
Symbolic Butt posted:I had a similar experience, the build system was too complicated back then and I had limited time so I decided to just go back to regular javascript this is also me every time I've ever thought "oh man I'm totally going to use typescript on this next project" before just going back to jarvascript.
|
# ? Feb 6, 2019 18:50 |
|
god I loving hate js
|
# ? Feb 6, 2019 18:51 |
|
Symbolic Butt posted:I had a similar experience, the build system was too complicated back then and I had limited time so I decided to just go back to regular javascript thats how I feel every time I try to do nodejs, and then I go back to Java
|
# ? Feb 6, 2019 18:55 |
|
more than once Ive installed docker on a machine only so I could install node in a container. as to not sully my development environment
|
# ? Feb 6, 2019 19:09 |
|
The build system is you run "yarn run tsc" idk what's difficult about this If you are using it with a react web app then you run "yarn run parcel" instead
|
# ? Feb 6, 2019 19:24 |
|
why does javascript, an interpreted language whose linkage model is "everything in one global scope as though it were a single file", have a build system
|
# ? Feb 6, 2019 19:25 |
|
because it's a bad language for idiots
|
# ? Feb 6, 2019 19:28 |
|
ugh i cant wrap my head around how to structure my python module. i keep wanting to split classes out into their own files, but it makes imports super hosed up im too used to java i think is there a good primer/example project that i can look at?
|
# ? Feb 6, 2019 19:31 |
|
DELETE CASCADE posted:why does javascript, an interpreted language whose linkage model is "everything in one global scope as though it were a single file", have a build system hey you can totally skip the build system if you don't want compile-time checks or dependency management turns out those two things are kinda important for projects bigger than 'punch the monkey'
|
# ? Feb 6, 2019 19:36 |
|
DELETE CASCADE posted:why does javascript, an interpreted language whose linkage model is "everything in one global scope as though it were a single file", have a build system because someone decided that manually maintaining every single dependency by copying and pasting js files around was bad
|
# ? Feb 6, 2019 20:03 |
|
Soricidus posted:urgh lua is aggressively terrible in every way possible. dear everybody in the world: i know it's easy to embed lua but please have some consideration for your users and pick literally anything else instead. scheme, javascript, python, gently caress even perl would be better, goddamn this language is bad any time you have a choice of what to embed, scheme is the correct choice
|
# ? Feb 6, 2019 20:07 |
|
Chalks posted:because someone decided that manually maintaining every single dependency by copying and pasting js files around was bad isn't that more of a package managers job im mostly just glad I don't have to do webdev beyond some very basic things
|
# ? Feb 6, 2019 20:08 |
|
Krankenstyle posted:ugh i cant wrap my head around how to structure my python module. i keep wanting to split classes out into their own files, but it makes imports super hosed up hosed up how, like you get ImportErrors because your two modules now depend on each other? you should fix that circular dependency anyway as it'll lead to fewer headaches later. if you just mean you have a lot of imports and it's slower or something, don't worry about it but for the former, you basically have two options: - make your modules smaller / have them do less. if A depends on B which depends on A, take out one of the dependencies (ideally both) and put them in a separate module C, which depends on both A and B - make your modules bigger / have them do more. if the previous thing doesn't work, you can just combine the modules into one big one obviously the right choice depends on your exact code, and i'm not exactly sure what you expect to learn from the design of a completely different project
|
# ? Feb 6, 2019 20:47 |
|
Chalks posted:because someone decided that manually maintaining every single dependency by copying and pasting js files around was bad that's basically what npm does, since it's copying a dependency to every project. and those dependencies can change between runs of "npm install" because the entire js ecosystem is a broke mess. it's a poo poo system.
|
# ? Feb 6, 2019 20:56 |
|
Private Speech posted:isn't that more of a package managers job package manager to grab your dependencies, build system to turn them into something that isn't 100,000 separate files i guess honestly, the fact that javascript is completely unsuitable for even slightly complex projects is precisely why you need poo poo like build processes and typescript piled on top. they're all layers of engineering trying to hide the fact that you're using javascript
|
# ? Feb 6, 2019 21:11 |
|
CRIP EATIN BREAD posted:that's basically what npm does, since it's copying a dependency to every project. and those dependencies can change between runs of "npm install" because the entire js ecosystem is a broke mess. nobody sane will claim that npm is good nobody honest will claim that it's "basically" the same as "manually maintaining every single dependency by copying and pasting js files around"
|
# ? Feb 6, 2019 21:11 |
Krankenstyle posted:ugh i cant wrap my head around how to structure my python module. i keep wanting to split classes out into their own files, but it makes imports super hosed up IMO don't split classes into their own files, for exactly the reasons you are experiencing. Think of a module instead as a "unit of functionality", with related classes being in the same module. This "relation" can be pretty broad: for example in the python standard library most of the collections api is in a single module, with only collections.abc getting a submodule. Also, don't be afraid to have functions which aren't a part of a class. For examples of code organization for sizeable python projects, I think both youtube-dl and the cpython standard library implementation are pretty reasonable. If anyone else has good examples though definitely post them.
|
|
# ? Feb 6, 2019 21:45 |
|
lua status: wait, gently caress, all the people saying lua doesn't have native 64-bit integers are talking about old versions. in lua 5.3 numbers flip between 64-bit int and double as required, so all my problems are due to believing outdated information
|
# ? Feb 6, 2019 21:56 |
|
thx re python gonna separate out a chunk of code on a branch and see if it makes stuff clearer
|
# ? Feb 6, 2019 22:05 |
|
Soricidus posted:lua status: wait, gently caress, all the people saying lua doesn't have native 64-bit integers are talking about old versions. that's another hosed up thing about lua: the community is stuck on the lowest common denominator of lua 5.1 because luajit has a spat with lua or something and wont roll in changes from 5.2+, but everybody uses luajit because its a bazillion times faster
|
# ? Feb 6, 2019 22:05 |
|
lua's great if you're doing simple things in it, it's not great as an alternative to something like python. not that python's good, lua's just not good in that situation either also nim's great and I wish I had an excuse to write things in it, in terms of "languages that let me do dumb poo poo in fun ways" it even manages to rank higher than D, the language with 3 separate ways of doing metaprogramming. Falcorum fucked around with this message at 22:14 on Feb 6, 2019 |
# ? Feb 6, 2019 22:11 |
|
every time i google how to do something in lua the first result is the official wiki saying there's no built-in way to do it but here's five solutions from the community each of which have slightly different behavior
|
# ? Feb 6, 2019 22:29 |
|
Sapozhnik posted:The build system is you run "yarn run tsc" idk what's difficult about this ~/src/poo poo % yarn run tsc yarn run v1.12.3 error Couldn't find a package.json file in "/Users/turdshunter/src/poo poo" info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
|
# ? Feb 6, 2019 22:44 |
|
Krankenstyle posted:thx re python the second you want to do differentiated files / folders with anything python you should look to another language I've been there and its not pretty and your imports will continue to look like satan took a poo poo all over them. Hell at one point even "import *" began looking good
|
# ? Feb 6, 2019 23:41 |
|
Sapozhnik posted:The build system is you run "yarn run tsc" idk what's difficult about this naw dude, if you need to support IE 11 or older (and of course you need to) you need to first compile typescript to es6/es7/esnext/whateverthefuck so you can actually use things you probably want, and then transpile that output to es5 with babel. then you need to minify it of course. dehumanize yourself and face to webpack, and i hope you like long compile times things are actually easier these days than they used to be, but gently caress, c++ has less complicated and more user-friendly build systems than javascript does TheFluff fucked around with this message at 23:50 on Feb 6, 2019 |
# ? Feb 6, 2019 23:46 |
|
Finster Dexter posted:~/src/poo poo % yarn run tsc PS C:\Users\james> mkdir WELLACTUALLY PS C:\Users\james> cd .\WELLACTUALLY\ PS C:\Users\james\WELLACTUALLY> yarn add -D typescript yarn add v1.13.0 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies +- typescript@3.3.1 info All dependencies +- typescript@3.3.1 Done in 0.43s. PS C:\Users\james\WELLACTUALLY> yarn run tsc --init yarn run v1.13.0 warning package.json: No license field $ C:\Users\james\WELLACTUALLY\node_modules\.bin\tsc --init message TS6071: Successfully created a tsconfig.json file. Done in 0.35s. PS C:\Users\james\WELLACTUALLY> echo "const you: string = 'tedious bore'; console.log(you);" > pedantry.ts PS C:\Users\james\WELLACTUALLY> yarn run tsc yarn run v1.13.0 warning package.json: No license field $ C:\Users\james\WELLACTUALLY\node_modules\.bin\tsc Done in 1.65s. PS C:\Users\james\WELLACTUALLY> type pedantry.js "use strict"; var you = 'tedious bore'; console.log(you);
|
# ? Feb 7, 2019 02:44 |
|
quite a roundabout way for me to go about signing my own posts but you get the idea (i'm actually defending javascript. look what you made me do)
|
# ? Feb 7, 2019 02:45 |
|
NihilCredo posted:nobody sane will claim that npm is good npm is indeed bad which is why you should use yarn instead. it'll actually make an effort not to randomly replace poo poo with different versions unless you explicitly ask it to do an upgrade (as in, it will maintain a list of urls of specific releases for all your deps as well as hashes for those releases in a file in source control). then again npm has been getting better about this as well lately, supposedly. DELETE CASCADE posted:why does javascript, an interpreted language whose linkage model is "everything in one global scope as though it were a single file", have a build system there's modules now. even web browsers support them (though you shouldn't really be making use of this support). only thing that's dragging its feet is node itself for some reason. modules are actually scoped as well, so you're not just #include-ing poo poo that being said you probably don't want your live web application to be deployed as 1000+ separate files that the web browser has to download, which brings us to TheFluff posted:naw dude, if you need to support IE 11 or older (and of course you need to) you need to first compile typescript to es6/es7/esnext/whateverthefuck so you can actually use things you probably want, and then transpile that output to es5 with babel. then you need to minify it of course. dehumanize yourself and face to webpack, and i hope you like long compile times TS transpiles all the way down to ES3 by default. or it can strip out the type definitions and otherwise emit your code as verbatim ~*modern javascript*~, or anything in between, depending on how you set up your tsconfig.json. it does more or less the same thing as babel so you don't actually need to use babel. for web applications parcel does all the typescript and babel and whatever other crap for you all fully preconfigured. if you need to support old IE then you'll have to add a "browserlist" list of strings to package.json explicitly stating what browsers you want to target, otherwise it will target the least common demoninator that currently has a 98% worldwide browser install base. this is even decently documented on parcel's website https://parceljs.org/javascript.html#default-babel-transforms but yeah parcel's usually as simple as invoking it against an entry point like src/index.html (which in turn will contain some <script> tags pointing to some js or ts files in your source tree or whatever) and it'll make a dist/ output directory with a single js file, single css file (including css module support), patched-up html file, it'll use babel to patch in things like your live API URL from your project's .env file, and so on. Parcel's conventions and operations are mostly non-negotiable though, so if you have particularly strong opinions on how the build output should look then yeah you're going to have to actually deal with programming some garbage like Gulp and Webpack or whatever... or, you could not care, use the defaults, and get on with your life. Can't speak to long compile times because I've only really used this for a medium-sized hobby project but Parcel is pretty good about incrementally recompiling stuff so it hasn't been an issue for me. like I've accepted that I'm probably going to get savagely owned for posting all of this, but hopefully the information in these posts will get through to at least one person who has been ordered to do a javascript thing and they'll maybe make use of it to lessen the misery they inflict on themselves and any subsequent people that have to maintain the result (again, please use react. and please don't use redux with react).
|
# ? Feb 7, 2019 03:10 |
|
Sapozhnik posted:PS C:\Users\james> mkdir WELLACTUALLY ng new
|
# ? Feb 7, 2019 06:43 |
|
you can target es3 with tsc all you want but it will not polyfill es6+ stuff. there are a few specific exceptions like generators/iterators (with --downlevelIterators) but in general if you want to target es5 you gotta write es5, but with types. the compiler can usually deal with syntactic sugar like the spread operator, and it will handle scoping issues caused by es5's lack of lexical scoping and arrow functions, but if you want to use things like Array.find() or String.repeat(), well, that's a type error. those are the easy ones since the compiler will actually catch them, but there's a number of subtle gotchas associated with this of course, so if you don't want your site to just say "undefined is not a function" in some browsers, you still need babel. js is still js. in a mature application webpack builds take several minutes, and you can't do incremental builds for deploys or in ci because they're not reproducible. various webpack tools have their own caches because they're dog slow, but good luck figuring out why the cache keeps getting invalidated. then one fine day you wonder why node_modules is over a gigabyte, you go digging and find it's mostly Babel cache files, because of course it's enabled by default, puts poo poo in node_modules by default and never cleans up after itself. gently caress js tooling. TheFluff fucked around with this message at 10:13 on Feb 7, 2019 |
# ? Feb 7, 2019 10:04 |
TheFluff posted:in a mature application webpack builds take several minutes Compared to java WAR building and the like, our js has actually been the least time-consuming aspect of pushing stuff to servers. e: not to say that all's good in js land of course
|
|
# ? Feb 7, 2019 11:44 |
|
Boiled Water posted:the second you want to do differentiated files / folders with anything python you should look to another language figured out a way to abstract all the messy file/resource access stuff into a Workspace object so the other objs don't have to care about path configurations, json parsing, etc. much neater!
|
# ? Feb 7, 2019 12:16 |
|
Osmosisch posted:Interesting, I wonder what causes this for you. For what it's worth, this has not been our experience (pushing 100k LoC) - more like 30s for total dev rebuild, ~50s for extremely-uglified production. And then a couple seconds for partial rebuilds which is the most relevant since that's where the dev friction mostly lives anyway. Yeah out Webpacking doesn't take anything like that long. Our full build is about 20 mins from scratch. The Webpacking part is barely noticeable, especially compared to the SASS bits that take ages.
|
# ? Feb 7, 2019 12:32 |
|
Aramoro posted:Yeah out Webpacking doesn't take anything like that long. Our full build is about 20 mins from scratch. The Webpacking part is barely noticeable, especially compared to the SASS bits that take ages. I can build our C++ app from scratch about 10 times in 20 minutes.
|
# ? Feb 7, 2019 13:45 |
|
Xarn posted:
We have a pretty big build. Ear with 5 WAR's, about 550mb total.
|
# ? Feb 7, 2019 13:49 |
|
|
# ? Apr 18, 2024 23:48 |
|
Aramoro posted:Yeah out Webpacking doesn't take anything like that long. Our full build is about 20 mins from scratch. The Webpacking part is barely noticeable, especially compared to the SASS bits that take ages. lmao I work on one of those lardass open world AAA game and our compilation time is 20min Zlodo fucked around with this message at 14:12 on Feb 7, 2019 |
# ? Feb 7, 2019 14:09 |