Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Valeyard
Mar 30, 2012


Grimey Drawer

fart simpson posted:

me too. i used to use python but honestly haskell is better at most of the scripting needs i have

If you need to do parsing, Haskell ftw

Adbot
ADBOT LOVES YOU

Valeyard
Mar 30, 2012


Grimey Drawer
Can't get enough Parsec

Luigi Thirty
Apr 30, 2006

Emergency confection port.

lol reactos

didn't they raise a jillion dollars on Kickstarter to become a bad wine frontend or something

MrMoo
Sep 14, 2000

Aren't we still awaiting the super Made-in-Korea-OS that is a gigantic copy & paste of Wine & ReactOS?

Notorious b.s.d.
Jan 25, 2003

by Reene

Valeyard posted:

Can't get enough Parsec

http://www.openparsec.com/screenshots.php

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS
vc++ really doesn't let you specify things like what registers are used in your inline assembly? How is that supposed to ever work? I'm the guy at microsoft who thought about it for like 3 seconds and decided "yeah, we'll parse the assembly and figure it out".

gonadic io
Feb 16, 2011

>>=

gonadic io fucked around with this message at 16:28 on Dec 14, 2015

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I use racket for most of my toy parsing bullshit, it suits my needs

I still need to check antlr, and read that parsing book. wanna be a parsing master

Jerry Bindle
May 16, 2003
nothing beats racket for parsing lisps. if you wanted to parse a C or a Java with racket, you could do it bc the racket reader is really good and flexible but you'd have to build the ast etc manually. antlr does a bunch of the heavy lifting for you, it'll build the ast and provide a few different ways to walk the tree. it gives you a sax2 type call back interface by default, but you can flip a switch for it to give you a visitor interface too

Jerry Bindle
May 16, 2003
i learned about the racket syntax/parse library on saturday and boy howdy it propelled my go-no-where pipedream scheme to dspic compiler forward. i still have no clue how to implement continuations or tail call optimization but it sure is fun writing sytnax parsers that reduce things to core forms

Notorious b.s.d.
Jan 25, 2003

by Reene

Jeffrey of YOSPOS posted:

vc++ really doesn't let you specify things like what registers are used in your inline assembly? How is that supposed to ever work? I'm the guy at microsoft who thought about it for like 3 seconds and decided "yeah, we'll parse the assembly and figure it out".

they literally did parse the assembly. you could use c variables, macros, etc inside your inline assembly.

i don't think it worked that well: they dropped this feature for amd64 and ia64

MrMoo
Sep 14, 2000

Notorious b.s.d. posted:

they literally did parse the assembly. you could use c variables, macros, etc inside your inline assembly.

i don't think it worked that well: they dropped this feature for amd64 and ia64

dropping inline assembly was required to get people to use intrinsics, lazy developers aren't going to change on their own.

Jerry Bindle
May 16, 2003
all it takes is intrinsics to be broken once for people to not trust them. we have a builtin functions for writing and reading flash memory, well, those sometimes break on a part with a new nvm controller or something. sometimes its easier to just type out 11 lines from the datasheet and have a medium-high confidence something works instead of 1 line from the compiler manual and get bit by it later

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Brain Candy posted:

but if i don't sprinkle volatile everywhere it's not thread-safe

volatile has a different meaning for asm(), it means the compiler must treat the block of inline assembly as sacred: can't hoist out of loops, can't move it around, can't delete it if the outputs are unused. some instructions need to be marked volatile (for example if they have side effects that you can't express with the available constraints), some don't (you can safely delete some complex SIMD operation if the compiler determines that it's a no-op)

of course I was bitten in the rear end by this in that very header file, because volatile isn't granular enough for some cases and I had omitted from intrinsics that really should have been treated more carefully. I actually broke the kernel because they were super-critical kernel-only instructions for setting up virtual memory (IIRC)

I was a huge knob back then, with torvaldsisms like that comment, draconian abe-like moderation of the IRC channel and starting a tradition of passive aggressive commit messages, but tbh I did do a huge amount of work to reverse-engineer all known x86 intrinsics, especially determining what functions had the equivalent of a "memory" clobber (i.e. "this touches memory so don't trust the values you think variables have") and what didn't (possibly erroneously). at the time I didn't know much about aliasing (still don't actually) so they're probably wrong anyway :shrug:

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Jeffrey of YOSPOS posted:

vc++ really doesn't let you specify things like what registers are used in your inline assembly? How is that supposed to ever work? I'm the guy at microsoft who thought about it for like 3 seconds and decided "yeah, we'll parse the assembly and figure it out".

no, it's not quite like that. let me explain. this is __cpuid, as implemented for gcc/clang:

C++ code:
void __cpuid(int CPUInfo[4], int InfoType)
{
	__asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType));
}
in Visual C++, before the compiler implemented __cpuid as an intrinsic, you'd have had to do something like:

C++ code:
void __cpuid(int CPUInfo[4], int InfoType)
{
	asm {
		mov eax, InfoType

		// assuming we don't even have cpuid available as an opcode
		_emit 0Fh
		_emit 0A2h

		mov CPUInfo[0], eax
		mov CPUInfo[1], ebx
		mov CPUInfo[2], ecx
		mov CPUInfo[3], edx
	}
}
the C compiler has to implement a weird DSL that's x86 assembler but sometimes the expressions are in C. I don't think they every really documented the syntax, I wonder in fact if this code even compiles as written. the compiler will also not dare touch your assembly and emit it as-is. what else it could do? there's an _emit there, who knows what goofy instruction it outputs. the compiler has no way of knowing that the mystery instructions reads eax and overwrites eax, ebx, ecx and edx, so it has to be super-careful and very, very literal. say some code calls __cpuid and only reads CPUInfo[1], the compiler won't know that it can safely omit the moves from eax, ecx and edx. there is no way to safely inline this function, either, without a lot of assumptions and super-defensive code (did the mystery instruction write to esi? edi? did it even write to ebx?)

the beauty of GCC inline assembly is that the compiler doesn't even have to know what cpuid does, in fact it doesn't, it only operates on the inline code as a string with special format inserts. all the compiler needs to know is in the constraints: the inline asm takes "a" (eax) as an input, and overwrites "=a", "=b", "=c" and "=d" (eax, ebx, ecx and edx)

Microsoft inline assembly is a toy for DOS-era programmers and little else (among the little else: competitor Borland had it too)

Vanadium
Jan 8, 2005

ms inline asm looks a lot more readable tho

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS

hackbunny posted:

no, it's not quite like that. let me explain. this is __cpuid, as implemented for gcc/clang:

the beauty of GCC inline assembly is that the compiler doesn't even have to know what cpuid does, in fact it doesn't, it only operates on the inline code as a string with special format inserts. all the compiler needs to know is in the constraints: the inline asm takes "a" (eax) as an input, and overwrites "=a", "=b", "=c" and "=d" (eax, ebx, ecx and edx)

Microsoft inline assembly is a toy for DOS-era programmers and little else (among the little else: competitor Borland had it too)

Yeah gcc inline assembly I know how to use, I still don't love it, but it functions sufficiently well for my needs. (if its more than, say, 10 instructions, it should probably have it's own function header in a .S file unless you're doing something really special.) The microsoft approach is completely nuts. I guess one generally doesn't write kernel mode code with vc++ but there are a fuckload of weird instructions, how could microsoft think they could properly annotate the side effects of all of them? That's without considering other platforms, like arm, where every implementation is going to have a whole bunch of very system-specific coprocessor instructions. Actually supporting it would require your (closed-source commercial) compiler to understand all of them, it would never work.

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
I'm so glad HTML5, Android, and IOS is killing Java. The faster this happens the happier everybody can be.

Notorious b.s.d.
Jan 25, 2003

by Reene

bobbilljim posted:

I'm so glad HTML5, Android, and IOS is killing Java. The faster this happens the happier everybody can be.

even i agree

java in the browser never really worked. the whole kit and kaboodle is a failed experiment. oracle very obviously doesn't care about it, so the sooner it dies, the better.

Soricidus
Oct 21, 2010
freedom-hating statist shill
brb implementing a jvm in javascript so we can try this again but done right this time

Bloody
Mar 3, 2013

https://github.com/Jivings/jsJVM

MeruFM
Jul 27, 2010
why did coffee script ever become a thing

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i think it was one of the omakase offerings of rails for a bit. that's the only reason i can imagine.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
it's like the sea urchin in the hand crafterd offering that is ruby on rails

MeruFM
Jul 27, 2010
my only experience with coffee script is hubot but the idea seems to be
1. better for loop
2. forced var scope
3. unreadable garbage

Soricidus
Oct 21, 2010
freedom-hating statist shill

gently caress poe's law

Brain Candy
May 18, 2006

hackbunny posted:

volatile has a different meaning for asm(), it means the compiler must treat the block of inline assembly as sacred: can't hoist out of loops, can't move it around, can't delete it if the outputs are unused.

seems like this is the same meaning of volatile in C/C++. as in you are telling compiler to not make any assumptions from what it can see in the code and just do what it was told

but i just trying to provoke you into effortposting :v:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
code:
//coffeescript
jDataView.createBuffer = ->
  if typeof ArrayBuffer isnt "undefined"
    buffer = new ArrayBuffer(arguments.length)
    view = new Int8Array(buffer)
    i = 0

isnt

isnt

isnt

Shaggar
Apr 26, 2006
I hate javascript and coffeescript isn't good

Shaggar
Apr 26, 2006
typescript seems like it would be the way to not write javascript but I think it still means you're doing too much client side crap

Sagebrush
Feb 26, 2012

does sublime text ever go on sale? i would like to support them, but i think i only use it about $20 or $30 worth, not $70.

akadajet
Sep 14, 2003

Sagebrush posted:

does sublime text ever go on sale? i would like to support them, but i think i only use it about $20 or $30 worth, not $70.

Nope, they just raise the price every once in awhile.

I switched to atom because it's the same thing but actively maintained. Also free.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
yeah just use atom now

Arcsech
Aug 5, 2008

Sagebrush posted:

does sublime text ever go on sale? i would like to support them, but i think i only use it about $20 or $30 worth, not $70.

Nope

Sublime text is a dead project anyway, use visual studio code for the same niche

Alternatively spacemacs, which is really, really good if you like vim style editors

Arcsech
Aug 5, 2008

akadajet posted:

Nope, they just raise the price every once in awhile.

I switched to atom because it's the same thing but actively maintained. Also free.

VS code is atom but less lovely

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i really want to go back to using spacemacs. it was really good but i couldn't get my setup working with linux when I started here so I just went back to vim.

Bloody
Mar 3, 2013

just use vim

MeruFM
Jul 27, 2010
i want to like atom but it feels slow

might as well just use vs/eclipse at that point

maybe it's better now?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
it seems as fast as sublime

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012

ok so i ran the atom installer and it just...ran. installed atom to my user folder for some reason (windows). i google around to figure out "huh? why did it do this?" b/c i like having programs in the program files folders, as microsoft's guidelines suggest.

quote:

@hichris1234 Once the app is installed, you can move %LocalAppData%\Atom to wherever you want, then use mklink /D %LocalAppData%\Atom D:\Path\To\Where\You\Put\Atom and everything will work, even updates.

quote:

But I shouldn't need to. Look at any program on Windows. Try to install it. In the installer, 99% of the time there's an option for "where do you want to install this program?" (I can think of only a few exceptions, such as Chrome). However, for Atom, there isn't.

quote:

Don't care what 20 years of bad software has done in the past! Users shouldn't be asked arbitrary dumb questions like this, they double-click Setup and their program runs. That's it. Squirrel will never, ever, ever, ever, ever change this.

and after many questions asking why will you never change this? we end up with

quote:

Nope! This decision is made so that updates can happen in the background without UAC prompts.

never loving change, github

  • Locked thread