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
leftist heap
Feb 28, 2013

Fun Shoe
how does an idiot like me start learning about creating a programming language targeting the jvm. like, an ML style language with type inference. I have rudimentary knowledge of poo poo like parsing, compilers, etc. but have no idea how to start targeting the jvm. is it totally retarded to compile from mylang -> java -> java byte code? because that would be my utterly naïve approach.

should I break down and read the dragon book or are there better references out there now?

Adbot
ADBOT LOVES YOU

MeruFM
Jul 27, 2010

EVGA Longoria posted:

it's the google picker

Google seems fine with it as long as it's encrypted of course.
https://developers.google.com/+/web/signin/client-to-server-flow

They prefer another method which looks like what you're trying to do.
https://developers.google.com/+/web/signin/server-side-flow

EVGA Longoria
Dec 25, 2005

Let's go exploring!

MeruFM posted:

Google seems fine with it as long as it's encrypted of course.
https://developers.google.com/+/web/signin/client-to-server-flow

They prefer another method which looks like what you're trying to do.
https://developers.google.com/+/web/signin/server-side-flow

i'll probably just do it and keep it encrypted, that flow doesn't look like it works quite right for the picker api stuff

Jerry Bindle
May 16, 2003

rrrrrrrrrrrt posted:

how does an idiot like me start learning about creating a programming language targeting the jvm. like, an ML style language with type inference. I have rudimentary knowledge of poo poo like parsing, compilers, etc. but have no idea how to start targeting the jvm. is it totally retarded to compile from mylang -> java -> java byte code? because that would be my utterly naïve approach.

should I break down and read the dragon book or are there better references out there now?

kawa is a scheme that runs on the JVM -- the source code base is small enough that you might be able to study it to figure out how they did it

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

rrrrrrrrrrrt posted:

how does an idiot like me start learning about creating a programming language targeting the jvm. like, an ML style language with type inference. I have rudimentary knowledge of poo poo like parsing, compilers, etc. but have no idea how to start targeting the jvm. is it totally retarded to compile from mylang -> java -> java byte code? because that would be my utterly naïve approach.

should I break down and read the dragon book or are there better references out there now?

there was some blog that was recently writing basically a tutorial on how to write the type inference system that haskell uses

Brain Candy
May 18, 2006

rrrrrrrrrrrt posted:

how does an idiot like me start learning about creating a programming language targeting the jvm. like, an ML style language with type inference. I have rudimentary knowledge of poo poo like parsing, compilers, etc. but have no idea how to start targeting the jvm. is it totally retarded to compile from mylang -> java -> java byte code? because that would be my utterly naïve approach.

should I break down and read the dragon book or are there better references out there now?

pretty retarded because you want be able to call invokeDynamic

see also https://docs.oracle.com/javase/8/docs/technotes/guides/vm/multiple-language-support.html

Brain Candy
May 18, 2006

welllll... i guess you don't need to use the new hotness but you'll be using reflection and invokeDynamic is neat

JewKiller 3000
Nov 28, 2006

by Lowtax

rrrrrrrrrrrt posted:

an idiot ... creating a programming language

please stop. we have enough of these.

if you insist on proceeding, please first read https://www.cis.upenn.edu/~bcpierce/tapl/

Soricidus
Oct 21, 2010
freedom-hating statist shill

JewKiller 3000 posted:

please stop. we have enough of these.

don't listen to this guy, it's really educational. do it, just don't try to get other people to use it.

well ... do listen to them when they recommend tapl I guess

leftist heap
Feb 28, 2013

Fun Shoe

JewKiller 3000 posted:

please stop. we have enough of these.

if you insist on proceeding, please first read https://www.cis.upenn.edu/~bcpierce/tapl/

don't worry i never finish any of my side tracks anyway.

although now that i've said that i'm going to fumble my way into somehow creating the next idiot popular plang.

that link looks cool

crazypenguin
Mar 9, 2005
nothing witty here, move along

rrrrrrrrrrrt posted:

how does an idiot like me start learning about creating a programming language targeting the jvm. like, an ML style language with type inference. I have rudimentary knowledge of poo poo like parsing, compilers, etc. but have no idea how to start targeting the jvm. is it totally retarded to compile from mylang -> java -> java byte code? because that would be my utterly naïve approach.

yeah just emit java code and then compile that. everything else is like trying to optimizing the compiler or the language before you figure out what your toy language even is.

break things into littler steps

Jerry Bindle
May 16, 2003
is it possible to silence the voice in your head that says "if you generate java code, you might miss out on some cool JVM internal thing that you could use to have a cool new feature in your language, like that invokedynamic or whatever."

its so hard to stop getting lost in the minutiae till the point you get so burnt out that you start working on some other goes-no-where side project

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

make sure the JVM can express what you want to build, too. targeting the CLR might work better.

oh no blimp issue
Feb 23, 2011

so ive got a technical test tomorrow for an interview and it might have some sql on it, what kind of dumb sql questions do these tests contain usually?

brap
Aug 23, 2004

Grimey Drawer
if you have some boats how would you SELECT the boats WHERE the sails are red or green

oh no blimp issue
Feb 23, 2011

fleshweasel posted:

if you have some boats how would you SELECT the boats WHERE the sails are red or green

I DONT EVEN KNOW

Necc0
Jun 30, 2005

by exmarx
Broken Cake

Awia posted:

so ive got a technical test tomorrow for an interview and it might have some sql on it, what kind of dumb sql questions do these tests contain usually?

if being an sql jockey won't be your primary role it probably won't be any more complex than knowing the difference between different kinds of joins and MAYBE sub-queries if they're feeling sassy

Valeyard
Mar 30, 2012


Grimey Drawer
id expect them to pose a question with an answer involving having to choose which kind of JOIN to use

oh no blimp issue
Feb 23, 2011

cool cool! thanks dudes

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
I interviewed for a db jockey role once and had discussions about the different kinds of SQL transaction isolation levels, 2 phase commit and had to white board some queries that progressed from easy SELECTs, to using the various kinds of joints, into using a windowing function on a self joined table with aggregate functions.

I learned some new SQL commands and syntax thanks to some gentle prodding from the interviewer, the interviews where you actually learn something are always the best.

Lunar Suite
Jun 5, 2011

If you love a flower which happens to be on a star, it is sweet at night to gaze at the sky. All the stars are a riot of flowers.
i'm interning in a lab for nanomedicine, and they thougt the ~cloud-based~ solution for their digital PCR sucks (manually drawing circles around data points, not being able to safe them, etc), and me being an idiot I was like "hey i can program a little , should i try to make something" by which i meant i once wrote an irc bot in python.

so next to labwork (cancer cell dna shenanigans, yay) i spent the first month working on something that ended up being a 16mb excel macro, cobbled togetehr from bits i found online and slowly frankensteined. the work network being poo poo, it took half a minute to save or copy to a usb for backup

then my boss joked about selling the final product to life technologies once i'm done and i was torn between laughing my arse off at the idea of them selling a 16mb excel macro written by the intern to life tech, and screaming internally because he was a little serious.

i realized that to do what the program needs to do (data sorting in a specific way) it'd need to fit and/or work with ellipses. which i sure as gently caress wasn't gonna get in VBA. I found code samples for ellipsis stuff in MATLAB, Python and C#, from which i pierced together how the algorithm kinda sorta worked (as a biochem major, matrix math is loving confusing to me).
i knew a little c# also and have vs on my home pc, so i started to work from home whenever there was nothing to do at the lab. lerned windows froms based programming from stack overflow and now... well, it's poo poo but less so that before?? now you give it data and it tries to draw the best ellipsis around it. it doesn't owrk, but there's an ellipsis and it's rotated right!
then i worked on trying to make the user interface less poo poo. if i could figure out how to properly get the ellipsis to drag and drop without spazzing out all over the graph, that'd be keen. but it kinda runs, and i learned a lot in my internship. parts of it even related to biochemistry!

my bosses visited me at home and showed the prototype off to our contact at Life Tech.
are all americans really excited about any sort of technology, no matter how lovely? cos he thought it looked cool as gently caress.
well, if the planets align, i might get money out of this, har har.

after i remove all the cussing from the source code i guess.

MeruFM
Jul 27, 2010
nice humblebrag

people who are not into computers are simultaneously surprised/delighted at what little gimmick a single programmer could do to speed up a very specific task while also extremely angry at their OS/phone if it lags for a second as it runs through 50 abstraction layers of lovely code.

so it's not an american thing, it's a normal person thing.

Lunar Suite
Jun 5, 2011

If you love a flower which happens to be on a star, it is sweet at night to gaze at the sky. All the stars are a riot of flowers.
i was working for apple as tech support once, though. every non-american customer did not give a poo poo about what features i had to tell them about (yay scripts). the american caller i once had was totally off her loving rocker when i told her about ~new features~.

and yeah, after two months of creating the thing i admit i'm invested into it, so that was a pretty bad humblebrag. sorry!
but i had to do the thing the program is supposed to do manually and it took me like two hours for 20 files or so. gently caress that.

i've gotten a recommendation for http://www.amazon.de/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 - any thoughts there? if i'm gonna have programming as a skill i want to do it properly.

e: the scary thing is when you try to tell someone, anyone about what you're doing to get some sort of feedback or instruction and you're the only one who knows what you're talking about. didn't expect that to happen before i start my phd.

Lunar Suite fucked around with this message at 22:21 on Mar 24, 2015

MeruFM
Jul 27, 2010
I don't know that book. But it references agile in the title so I'm already wary.

poorly written code is endemic in science fields because the person writing assumes no one else will read it or they themselves will not need to maintain after a few months.

The best general advice for good clean code is to write it as though you need to hand it off to someone else. And that someone else has 100% access to you if they don't understand something. So keep it easy to read because people are going to be spending a lot more time reading than you writing.
Very basic examples: Don't create 5 nested for loops. Keep logic simple. Split duplicate code into functions.

I think if you follow that rule, your code will just slowly become better as you write a lot of programs and find issues with each of them that run counter to the rule.

I like this book because it teaches you how to be an accountable professional instead of teaching programming tricks.
http://www.amazon.com/dp/020161622X

leftist heap
Feb 28, 2013

Fun Shoe

Barnyard Protein posted:

is it possible to silence the voice in your head that says "if you generate java code, you might miss out on some cool JVM internal thing that you could use to have a cool new feature in your language, like that invokedynamic or whatever."

its so hard to stop getting lost in the minutiae till the point you get so burnt out that you start working on some other goes-no-where side project

well a good first start would probably be not to jump straight to relatively advanced compiler optimizations when your side project is to create a useless toy language I dunno. you can't even get to the point of using invoke dynamic until you have a front end anyway and if you're emitting java code already then it's probably not a huge leap to emit jvm byte code after that. THEN you can look into invoke dynamic.

anyway I found a pretty good book all about targeting the jvm so I'm gonna read through that.

Lunar Suite
Jun 5, 2011

If you love a flower which happens to be on a star, it is sweet at night to gaze at the sky. All the stars are a riot of flowers.

MeruFM posted:

poorly written code is endemic in science fields because the person writing assumes no one else will read it or they themselves will not need to maintain after a few months.

which is funny because any r&d scientist will have to keep a lab book that's the epitome of proper documentation. I first encountered Good Documentation Practise in this internship and it's hard. i agree, though. tons of science tools are poo poo. many have grown out of being single-user programs that then got commercialized, i think. don't recall the name but during my undergrad thesis i developed a rageboner for some genetics program or other.

part of the reason i learned programming (other than 'gently caress doing all this myself, let a machine do it') was that the tools i found were bad, either in terms of design or documentation. if my work was gonna depend on poo poo code, it'd be my poo poo code. i have a friend who does dev stuff and his advice really helped me improve wrt/ documenting my code and adapting some better practises so i'd like to think i'm decent now. but never had anyone formally take a look so whatever.
i'll give the book a look, thank you!

Shaggar
Apr 26, 2006

Lunar Suite posted:

i was working for apple as tech support once, though. every non-american customer did not give a poo poo about what features i had to tell them about (yay scripts). the american caller i once had was totally off her loving rocker when i told her about ~new features~.

non-americans are pretty rude in general and not open to new things

Brain Candy
May 18, 2006

i brought up invokedynamic because of this

Subjunctive posted:

make sure the JVM can express what you want to build, too. targeting the CLR might work better.

lambdas in java were implemented using it (originally introduced to talk to jruby or jpython, etc.) because the existing calls weren't expressive enough

leftist heap
Feb 28, 2013

Fun Shoe
i didn't realize lambdas were done with invokedynamic

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

this is probably also a good time for me to bang the type erasure drum

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
as long as you bang it slowly

leftist heap
Feb 28, 2013

Fun Shoe
i started reading this book

http://www.cs.umb.edu/j--/index.html

and it seems ok, but the code itself probably is typical mediocre/bad professor code

Valeyard
Mar 30, 2012


Grimey Drawer
I like tombstone compiler diagrams

JewKiller 3000
Nov 28, 2006

by Lowtax
look man, if you're serious, you need to read TAPL. you can skip the heavy theory sections because you're presumably not trying to get a phd (if you are, read the whole thing cover to cover). once you're done, you can move on to "advanced topics in types and programming languages" or you can say gently caress that poo poo and go in another direction. but right now you are not equipped to make that decision

Brain Candy
May 18, 2006

nah, just rasmus out a lil' lang

leftist heap
Feb 28, 2013

Fun Shoe
i'm getting mixed signals here but that book is like 600 pages so

Marzzle
Dec 1, 2004

Bursting with flavor

rrrrrrrrrrrt posted:

i didn't realize lambdas were done with invokedynamic

can someone show a really stupid example of java lambda stuff because i've googled around for it before and it just sorta assumes you know a bit about them anyway. I actually asked some lovely comp sci ta's and they didn't know that java had lambda expressions but i just wanna car extends vehicle bad programmer example of how they are used and why they are useful since I am p sure my school isn't actually gonna tell me. they seem like they are only good for finding instances of an object in some collection that have properties that fit a specific criteria but it seems like it should probably be able to do a lot more if it was important enough to bring over from other languages. I've been lookin at this

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Marzzle posted:

can someone show a really stupid example of java lambda stuff because i've googled around for it before and it just sorta assumes you know a bit about them anyway. I actually asked some lovely comp sci ta's and they didn't know that java had lambda expressions but i just wanna car extends vehicle bad programmer example of how they are used and why they are useful since I am p sure my school isn't actually gonna tell me. they seem like they are only good for finding instances of an object in some collection that have properties that fit a specific criteria but it seems like it should probably be able to do a lot more if it was important enough to bring over from other languages. I've been lookin at this

the example literally just above that passage is pretty good

code:
btn.setOnAction(
  event -> System.out.println("Hello World!")
);
you have a callback method that you want to have happen in response to something (for example, in response to a particular button in the ui being clicked). the "normal" java way is some serious kingdom-of-nouns bullshit where you have a ThingDoer interface with a doThing() method, and you create an an anonymous class which overrides doThing() with the code you want to run, and you pass an instance of that class to whatever actually needs it. a lambda is basically syntactic sugar that lets you skip all that pointless boilerplate.

Marzzle
Dec 1, 2004

Bursting with flavor

Jabor posted:

the example literally just above that passage is pretty good

code:
btn.setOnAction(
  event -> System.out.println("Hello World!")
);
you have a callback method that you want to have happen in response to something (for example, in response to a particular button in the ui being clicked). the "normal" java way is some serious kingdom-of-nouns bullshit where you have a ThingDoer interface with a doThing() method, and you create an an anonymous class which overrides doThing() with the code you want to run, and you pass an instance of that class to whatever actually needs it. a lambda is basically syntactic sugar that lets you skip all that pointless boilerplate.

that's pretty cool, the whole reason i've been trying to figure them out is because they seem to be a staple of a javafx gui

i've never written a swing ui so i guess i don't really know what the hyper verbose way of doing it would be but i would assume it's just the regular java sorta multi line method call on method call on method call and stuff

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill
I think I have severe swing stockholm syndrome because event listeners don't even seem verbose any more

  • Locked thread