|
Javascript is unpleasant much in the same way assembly is unpleasant. It's verbose and asks for lots of boilerplate. Fortunately, you can target Javascript from a higher level just like you can target assembly from a higher level. Personally I use CoffeeScript all the time but I keep meaning to check out Dart.
|
# ? May 20, 2013 02:02 |
|
|
# ? Jun 4, 2024 09:36 |
|
BigRedDot posted:Javascript is unpleasant much in the same way assembly is unpleasant. It's verbose and asks for lots of boilerplate. Fortunately, you can target Javascript from a higher level just like you can target assembly from a higher level. Personally I use CoffeeScript all the time but I keep meaning to check out Dart. The I/O sessions had some pretty interesting stuff. They had a demo of Dartium, which is a Chromium modified to have a Dart VM, and it had some pretty dramatic speed improvements. Dart->JS was only something like 1-2% slower than plain Javascript, and Dart run directly was multiple times faster than JS.
|
# ? May 20, 2013 02:09 |
|
Thermopyle posted:I get your point, but I think there's a lot of languages where you wouldn't have as large a portion of developers saying the same sort of things they say about JS. IMO the difference is this: all languages are flawed, and it'd be difficult for one language to be good at everything, but many languages are at least good at SOMETHING. these are the ones that become popular, typically! python is easy to learn and can be used to combine the results of fast c extensions. that makes it good for science. java is easy to componentise. that makes it good for large teams. haskell has a very expressive type system. that makes it good for proofs. c++ is portable, highly abstract, and high performance. that makes it good for game engines. javascript derives its popularity not from being good for web development, but from being NECESSARY for web development. it was written in about a week by one guy and then retrofitted with syntax which didn't match its semantics. Netscape did this because of the enormous commercial opportunity, to lock people in to a language that would be hugely important- and they succeeded. first mover advantage and then standardisation in a world of competing web renderers lead to ecmascript's apparently unbreakable monopoly. look how many projects compile stuff to javascript. it is the assembly language of the web - universal because it is the lowest level *available*. not because of its merit. and now that universality leads to "full-stack" experimentation & it ends up running in problem domains even *less* amenable to its weirdass gotchas & morass of other-than-"The Good Parts". this is not to say that javascript doesn't have merits. it has a powerful object literal syntax - no coincidence that these js-outside-browser systems revolve around mongodb. it has strong support for asynchronous callbacks, an important UI technique. but if it weren't for historical accident, there's no reason to believe we'd be using something like javascript to achieve - the actual goal - our DHTML.
|
# ? May 20, 2013 06:26 |
|
BigRedDot posted:Javascript is unpleasant much in the same way assembly is unpleasant. It's verbose and asks for lots of boilerplate. Fortunately, you can target Javascript from a higher level just like you can target assembly from a higher level. Personally I use CoffeeScript all the time but I keep meaning to check out Dart. I considered CoffeeScript but the syntax is just so janky. f () -> 2 does something different from f() -> 2, and f x, y, g z, a, b probably doesn't do what you think it does at first glance.
|
# ? May 20, 2013 07:06 |
|
Imagine if you tried to improve JavaScript by using a bunch of regex replacements to implement various syntactic sugars, and as you added more of them you eventually decided that regexes wouldn't cut it and so you wrote a proper parser (but still kept backwards-compatibility), and then you decided to release it publicly and keep tacking on more syntactic sugar. That's kind of what CoffeeScript feels like to me.
|
# ? May 20, 2013 07:25 |
|
CoffeeScript is just polishing up a...thing, but not really improving on it IMO. What I've seen of Dart has been very promising. It feels like a proper language.
|
# ? May 20, 2013 08:36 |
|
Doctor w-rw-rw- posted:What I've seen of Dart has been very promising. It feels like a proper language. I've the opposite impression. Dart feels like trying to import all the accidents of Java into JS and none of the substance. It doesn't help that its creators are embarrassingly unfamiliar with the theory and practice of type systems.
|
# ? May 20, 2013 08:40 |
|
Otto Skorzeny posted:I've the opposite impression. Dart feels like trying to import all the accidents of Java into JS and none of the substance. It doesn't help that its creators are embarrassingly unfamiliar with the theory and practice of type systems. Dart isn't a JS-based language. Javascript is a target. What are the accidents, by the way? Also, given that the founder of the V8 project started Dart, I'd like to hear more details about their embarrassing lack of relevant knowledge.
|
# ? May 20, 2013 08:47 |
|
yaoi prophet posted:I considered CoffeeScript but the syntax is just so janky. f () -> 2 does something different from f() -> 2, and f x, y, g z, a, b probably doesn't do what you think it does at first glance. Eh, it's been fairly easy for me to adjust to, Ruby's parser is similar, and it's not like you need to actually use parentheses free style. More over, it's pretty much recommended when using function calls as arguments that if you're going to use parentheses free, it's only for the outermost statement, so f x, y, g(z, a, b). I do agree that Coffeescript is purely a syntactic sugar language, but I don't see that as such a bad thing. The problem with the assembler level analogy is that at present you still have to debug the Javascript, source mapping is still a bit janky to use because you get the line number but still have to observe the underlying Javascript to follow behaviour or expressions properly. Until we're at the point where you can debug without having to deal with the resultant Javascript, I feel like the precompiling languages can't diverge too far from Javascript's core.
|
# ? May 20, 2013 08:49 |
|
Maluco Marinero posted:Eh, it's been fairly easy for me to adjust to, Ruby's parser is similar, and it's not like you need to actually use parentheses free style. More over, it's pretty much recommended when using function calls as arguments that if you're going to use parentheses free, it's only for the outermost statement, so f x, y, g(z, a, b). Not to sound like a broken record, but Dart runs directly on its own non-Javascript VM (when not Javascript-targeted), and can do things like SIMD? vvvvv Edit: cool. Also, http://www.infoq.com/news/2013/05/Dart-Java-DeltaBlue - apparently it's got some pretty nice performance Doctor w-rw-rw- fucked around with this message at 10:02 on May 20, 2013 |
# ? May 20, 2013 09:42 |
|
Okay okay, I'll check it out.
|
# ? May 20, 2013 09:57 |
|
yaoi prophet posted:I considered CoffeeScript but the syntax is just so janky. f () -> 2 does something different from f() -> 2, and f x, y, g z, a, b probably doesn't do what you think it does at first glance. We had a memory leak at work in coffee script because someone forgot that: @object.foo a, b, c will call foo with parameters a, b, and c while: @object.foo will just get the value of foo and then throw it away with no left hand side.
|
# ? May 20, 2013 13:57 |
|
Doctor w-rw-rw- posted:Dart isn't a JS-based language. Doctor w-rw-rw- posted:What are the accidents, by the way? — n 1. an unforeseen event or one without an apparent cause 2. anything that occurs unintentionally or by chance; chance; fortune: I met him by accident 3. a misfortune or mishap, esp one causing injury or death 4. (logic, philosophy) a nonessential attribute or characteristic of something (as opposed to substance) The particular accidents of Java that I was referring to were its conventions on capitalization and its antipattern of classes-as-ersatz-namespaces. The substance which I was referring to Dart not grabbing from Java is its type system, which while flawed is certainly better than what Dart has. Doctor w-rw-rw- posted:Also, given that the founder of the V8 project started Dart, I'd like to hear more details about their embarrassing lack of relevant knowledge. Thank you for once again putting words in my mouth; I didn't say that the creators of Dart lacked knowledge relevant to implementing the least-bad VM for Javascript, but rather that they lacked knowledge of the theory and practice of type systems. I assume everyone who has looked at Dart's non type non system (type annotations that are meaningless by default with optional runtime assertions that aren't actually assertions, lol) and any even remotely modern type system ( ML's is a good example of a baseline static type system, while being decades old and quite simple; Python is a good example of a dynamic strongish type system that works well) can tell you that Dart programmers (assuming there are any outside of Google) are getting shortchanged.
|
# ? May 20, 2013 15:31 |
|
Dude, Otto, you might have a good argument in there somewhere but it's getting crowded by all those awful words. Any time you pull out a dictionary to define a word that a 3 year old would know, your argument stopped being persuasive and you started being a dick. So, on the topic of JavaScript. I'm going to say two things. One, this is a decently interesting paper on a canned successor to JavaScript and its type system that I think is fairly neat, and please look at where JavaScript is heading, with ECMAScript Next. It's disappointing that people are all discussing the future language of the web, and nobody has looked at what TC39, the ECMAScript Committee, is planning.
|
# ? May 20, 2013 16:26 |
|
Don't have a lot of experience with CMS', boss wants me to find a CMS to use to make an 'admin portal' for modifying / updating a db. We're stuck in a very specific environment (.net 3.5 among other things), so I've narrowed it down to DotNetNuke 6.2.x and MojoPortal. So I guess it would basically be a page-per-table and have some sort of excel-like table for modifying the data (or just a form with a bunch of fields). I'm working on a prototype and having a hard time figuring out how to approach it. Seems like I can't do anything with in-page functionality, so I'll need to plug-in some library and figure out how to tie it together I guess. It seems especially irrelevant since he just had me create an identical restful service for getting the data out of the database, but I'm out of here Friday so I know no longer give a poo poo (or if someone thinks they know the reasoning to his madness, I'd be happy to know more!). Hoping to re-use the business and transport objects from that project and then the only thing I'd have to do is tie it all together, somehow; but I'm failing to see how to do this outside of the traditional website model and within the scope of the CMS. Any help or direction to get started would be wonderful, not having much luck with the CMS documentation amid all the buzzwords titles and articles. Mr. Crow fucked around with this message at 16:33 on May 20, 2013 |
# ? May 20, 2013 16:31 |
|
Suspicious Dish posted:Any time you pull out a dictionary to define a word that a 3 year old would know, your argument stopped being persuasive and you started being a dick. I don't think your typical 3 year old (nor indeed your typical poster) is familiar with the Aristotelian distinction between substance and accidents, and was worried that my prior use of the term 'accidents' in that manner was being misunderstood to mean "mistakes", which is why I posted the definition and bolded the relevant part, which you seem to have ignored.
|
# ? May 20, 2013 17:00 |
|
Dicks can be quite persuasive.
|
# ? May 20, 2013 17:04 |
|
We should probably not assume too much about what the other "really" said.Otto Skorzeny posted:I didn't imply it was, thank you. Otto Skorzeny posted:The particular accidents of Java that I was referring to were its conventions on capitalization and its antipattern of classes-as-ersatz-namespaces. The substance which I was referring to Dart not grabbing from Java is its type system, which while flawed is certainly better than what Dart has. Otto Skorzeny posted:Thank you for once again putting words in my mouth; I didn't say that the creators of Dart lacked knowledge relevant to implementing the least-bad VM for Javascript, but rather that they lacked knowledge of the theory and practice of type systems. I assume everyone who has looked at Dart's non type non system (type annotations that are meaningless by default with optional runtime assertions that aren't actually assertions, lol) and any even remotely modern type system ( ML's is a good example of a baseline static type system, while being decades old and quite simple; Python is a good example of a dynamic strongish type system that works well) can tell you that Dart programmers (assuming there are any outside of Google) are getting shortchanged.
|
# ? May 20, 2013 20:02 |
|
Are IEEE floating points arranged any different in memory on little-endian systems as opposed to big-endian, or is that just integers? Oh my god I've got so much code to rewrite to be endianess-agnostic, someone please just loving give me a clean death
|
# ? May 22, 2013 03:31 |
|
Ciaphas posted:Are IEEE floating points arranged any different in memory on little-endian systems as opposed to big-endian, or is that just integers? Different systems will arrange floats differently, yes. Not all systems that are little-endian will swap bytes for floating point values, but some will.
|
# ? May 22, 2013 03:41 |
|
Is there a good book to read to help solidify good programming practices and techniques? I haven't done any serious programming in a few years and I am looking to kind of relearn things with good base this time around. I am familiar with a half dozen languages, and I have a reasonable grasp of how to program. I am mostly just looking to refine my skills from a CS perspective.
|
# ? May 22, 2013 04:40 |
|
Syle187 posted:Is there a good book to read to help solidify good programming practices and techniques? I haven't done any serious programming in a few years and I am looking to kind of relearn things with good base this time around. I am familiar with a half dozen languages, and I have a reasonable grasp of how to program. I am mostly just looking to refine my skills from a CS perspective. The OP from the Coding Beauty thread had a couple: I'm currently reading Kernighan & Pike, The Practice of Programming which is very good:
|
# ? May 22, 2013 08:18 |
|
Carthag posted:The OP from the Coding Beauty thread had a couple: Those are all good books but please don't try to read TAoCP, the dragon book, or the K&R book to learn good programming practices
|
# ? May 22, 2013 15:19 |
|
Seriously.
|
# ? May 22, 2013 15:20 |
|
I don't have my copy on hand, but as I recall the dragon book even says in the beginning that their example code has been deliberately written in a noobish style
|
# ? May 22, 2013 15:24 |
|
Otto Skorzeny posted:I don't have my copy on hand, but as I recall the dragon book even says in the beginning that their example code has been deliberately written in a noobish style That seems like a poor idea, unless figure 1A is "lovely code you will write" and then 1B is "good code you might write after 5+ years"
|
# ? May 22, 2013 16:19 |
|
Sab669 posted:That seems like a poor idea, unless figure 1A is "lovely code you will write" and then 1B is "good code you might write after 5+ years" Given that it's a book about compilers, source code maintainability may not have been their primary concern.
|
# ? May 22, 2013 16:20 |
|
Oh fair enough, I was thinking it was The Art of Computer Programming he was talking about, for some reason
|
# ? May 22, 2013 16:30 |
|
Can anyone explain where my thinking has gone awry with respect to little endian systems and bit-shift operators? http://codepad.org/5b5DbEBu C++ code:
pre:1 0xbf72c6f4 1 0xbf72c6f5 0 128 0xbf72c6f4 128 0xbf72c6f5 0 256 0xbf72c6f4 0 0xbf72c6f5 1 512 0xbf72c6f4 0 0xbf72c6f5 2 Ciaphas fucked around with this message at 18:59 on May 22, 2013 |
# ? May 22, 2013 18:45 |
|
Ciaphas posted:Why did left-shifting one from 128 make it 256 instead of making the sole high bit fall off the left side and make the whole thing zero? x is an int, a 32-bit signed integer on most systems. Your expectations would be correct if x was an unsigned char (and if CHAR_BIT is 8, which is true literally everywhere). Edit: Hold on, what. code:
You mean code:
|
# ? May 22, 2013 18:47 |
|
The hex I put in the comments there is how it seems to me to be laid out in memory (as affirmed by the pointer printouts), not its actual value. Which is what's confusing me about the shift operators.
|
# ? May 22, 2013 18:52 |
|
The shift operators operate on integers, not bytes in memory.
|
# ? May 22, 2013 19:30 |
|
Ciaphas posted:The hex I put in the comments there is how it seems to me to be laid out in memory (as affirmed by the pointer printouts), not its actual value. Which is what's confusing me about the shift operators. Okay. So the direction of the shift operators doesn't depend on how it's laid out in memory. It purely operates on the numerical value, and "left" and "right" refer to the classic way we write down numbers, with the least significant bit on the rightmost end. Imagine the value 1036 in a 32-bit int being written out in binary as 00000000000000000000010000001100. Then `1036 >> 3` will be 00000000000000000000000010000001. The bits are shifted to the right -- this is the same as dividing by 8 and rounding down. Now, in memory, these values might be laid out: unsigned char a[4] = { 0x0c, 0x04, 0x00, 0x00 }; unsigned char b[4] = { 0x81, 0x00, 0x00, 0x00 }; on a little-endian system.
|
# ? May 22, 2013 19:30 |
|
pseudorandom name posted:The shift operators operate on integers, not bytes in memory. shrughes posted:Okay. So the direction of the shift operators doesn't depend on how it's laid out in memory. It purely operates on the numerical value, and "left" and "right" refer to the classic way we write down numbers, with the least significant bit on the rightmost end. Oh. That'd about do it, then. Thanks
|
# ? May 22, 2013 19:36 |
|
What is a decent, goon-recommended raytracing tutorial? I can't manage to find any suitable for my admittedly feeble mind.
|
# ? May 23, 2013 13:18 |
|
Woodsy Owl posted:What is a decent, goon-recommended raytracing tutorial? I can't manage to find any suitable for my admittedly feeble mind. I like this guy's site and articles: http://iquilezles.org/www/articles/terrainmarching/terrainmarching.htm
|
# ? May 23, 2013 13:29 |
|
Woodsy Owl posted:What is a decent, goon-recommended raytracing tutorial? I can't manage to find any suitable for my admittedly feeble mind. Read a graphics-minded physics / geometry tutorial. The idea of raycasting is very simple, but actually doing it commands a knowledge of how complex geometry works, and how light actually interacts with objects on a scene.
|
# ? May 23, 2013 14:40 |
|
I've got a distributed application on a WAN where the nodes log data locally along with a timestamp - most of this data is only relevant to the local machine (memory consumption and so on), but with some of the log data I'd like to be able to perform diagnostics that correlate the timestamps created by multiple nodes (for example, if Node_1 transmits a message at Time_1 and Node_2 receives the message at Time_2, then I'd like to be able to take (Time_2 - Time_1) and know approximately how long it took the message to reach its destination). The nodes may be running on machines with inaccurate local clocks, so when a node initializes I query an NTP server to figure out the approximate clock error. However, I know fuckall about clock skew, and am wondering if this is good enough, or if I need to re-query the NTP server every minute, or every hour, or every day, etc. (assuming that any changes to the clock are a result of skew, and not a result of e.g. somebody manually changing the clock). loinburger fucked around with this message at 21:33 on May 23, 2013 |
# ? May 23, 2013 21:31 |
The NTP protocol is designed to work continuously, with the client constantly improving its clock precision. Just use NTP as intended and you should be fine. (There is also the SNTP, Simple NTP, which isn't able to do the continuous sync thing. Make sure you aren't actually using that.)
|
|
# ? May 23, 2013 21:39 |
|
|
# ? Jun 4, 2024 09:36 |
|
I am trying to intercept and modify network traffic going through an "ad-hoc" network running on my Windows 7 laptop (my laptop is the access point). Currently I am able to sniff the traffic, but I am at a loss with regards to actually stopping the packets at my machine and then re-sending them with extra modifications. The way network adapters work on Windows is total magick to me. (I can't use Linux because NVIDIA® Optimus™ Sucks© Balls℠)
|
# ? May 24, 2013 21:25 |