Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,818 members, 7,810,140 topics. Date: Friday, 26 April 2024 at 09:34 PM

Type Inference - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Type Inference (1317 Views)

What Mysql Select Type Can I Use For Picture/audio/video / I Need A Mentor In Web Programming Language Type Java / Do U Have Headset/headphone? Then Smash Your Keyboard Into Pieces. Type With Mou (2) (3) (4)

(1) (Reply) (Go Down)

Type Inference by ekubear1: 8:38am On Jun 13, 2013
For the new job I'll be starting next month, my team implements their systems in Scala. So I've been reading up a bit on the language.

I came across this really cool article on how Scala automatically infers types:

http://en.wikipedia.org/wiki/Type_inference

It is quite powerful. It makes writing Scala terse, almost like coding in Python or Ruby.

However, Scala programs compile to JVM bytecode, so are much faster than scripting languages.

So you get the best of both worlds...rapid coding, but near-native performance.

I find this pretty fascinating.
Re: Type Inference by Fayimora(m): 7:11pm On Jun 13, 2013
I am confident you'll love Scala. Type inference in Scala really does give that dynamic feel to the language. I've been writing a lot of Scala for a few months now and I can only say I'm addicted! It's even more fun when you program the FP way.
Re: Type Inference by ekubear1: 2:44am On Jun 14, 2013
I program pretty functionally as is in Python and Ruby (lots of lambda usage, list comprehensions, etc).

But yeah, I'm pretty excited about diving into Scala.
Re: Type Inference by Nobody: 9:27am On Jun 14, 2013
Mind you i haven't coded Scala or really Python, but i often wonder what makes Scala as popular as it is, cuz i quite hear a lot about it, especially from the twitter angle, compared to Java, what's it advantage ? thanx guys wink
Re: Type Inference by Fayimora(m): 1:13am On Jun 15, 2013
pc guru: Mind you i haven't coded Scala or really Python, but i often wonder what makes Scala as popular as it is, cuz i quite hear a lot about it, especially from the twitter angle, compared to Java, what's it advantage ? thanx guys wink
See this https://www.nairaland.com/1172724/grails-search-over#14019500
or better still see this: http:///14BIKnr
Re: Type Inference by Nobody: 1:25pm On Jun 15, 2013
Thanks i looked it up, it seems promising cuz am looking beyond the Web especially (PHP hacky like language), am still trying to ascertain it's application like for instance PHP=CGI/CLI Python=Everywhere, is it mostly Backend/Web or anywhere.
NOTE: Forget my questions if they are noobish, i intend to learn more wink
Re: Type Inference by tundebabzy: 1:56pm On Jun 15, 2013
pc guru: Thanks i looked it up, it seems promising cuz am looking beyond the Web especially (PHP hacky like language), am still trying to ascertain it's application like for instance PHP=CGI/CLI Python=Everywhere, is it mostly Backend/Web or anywhere.
NOTE: Forget my questions if they are noobish, i intend to learn more wink

+1
Re: Type Inference by Nobody: 2:11pm On Jun 15, 2013
oops i meant to write "Forgive"
Re: Type Inference by Fayimora(m): 3:14pm On Jun 17, 2013
We can talk about this(web languages) on a new thread. Create one and ping me. This thread is for Type Inference, sorry wink.
Re: Type Inference by ektbear: 8:07am On Jun 25, 2013
1. Scala worksheet rocks
2. Odersky videos on coursera rocks
3. Tail recursion, I didn't understand until today the point of it.
Re: Type Inference by Fayimora(m): 11:16pm On Jun 25, 2013
Hmm I guess we are talking about FP and Scala in general then. I like the worksheet but I hate IDEs so I only use it in certain circumstances. Specifically, when I'm showing off Scala smiley You should take the FP course the next time it runs. I started it but did not have the time to finish it unfortunately.
Re: Type Inference by ektbear: 12:34am On Jun 26, 2013
I use IPython a lot. But imo this worksheet is way better.

I am also not a fan of IDEs, but it seems the folks at my future job all use 'em for Scala development.

Regarding the FP course, I've watched up to week 5 right now (finishing the last video). I'm not doing any of the exercises though, just solving the problems he mentions during the lecture.

FP is kind of cool, but I'm not sure how efficient immutable data structures really are. For one of the project euler problems I did, I think the mutable hash map ran a lot faster than the immutable one.
Re: Type Inference by ektbear: 9:52am On Jun 26, 2013
Really interesting approach Scala takes to immutable vectors. Log(n) access time.
Re: Type Inference by ektbear: 10:17am On Jun 27, 2013
Streams are cool. I have a much nicer implementation of the Sieve of Eratosthenes using them.
Re: Type Inference by ektbear: 11:03am On Jun 27, 2013
Python has a version of streams called generators.

Ruby has one called enumerators (see here: http://www.michaelharrison.ws/weblog/?p=163).
Re: Type Inference by Fayimora(m): 6:24pm On Jun 27, 2013
You are really enjoying your journey into Scala. In terms of efficiency, I think in most cases it's not a problem and when you have to, you can simply use the mutable collections. One thing I always try to remember is what Knuth said regarding efficiency. "Premature optimisation is the root of all evil." I do not think about efficiency until I have a problem AND can prove that my immutable DS is the bottleneck. At the end of the day, it kinda boils down to what you are willing to trade-off.

I suggest you actually do the exercises in that course. The in-video exercises are nice but not challenging enough. Streams are nice but I hardly use them. I only started REALLY appreciating Scala when I started using it for programming competitions. It saves me loads of time! Most importantly, I focus more on the problem which is something you can't really do with non-fp languages.

Re: Type Inference by ektbear: 9:30pm On Jun 27, 2013
Yeah I just don't have a lot of motivation to do the programming exercises...I'd much rather just do project euler problems. I watched the videos mainly to understand then language from the author's perspective.

Btw, it looks like these notes (http://www.scala-lang.org/docu/files/ScalaByExample.pdf) overlap 95%+ with the video lectures he did.
Re: Type Inference by Fayimora(m): 11:10pm On Jun 27, 2013
Yeah he has been using that as a base for everything ranging from the lectures to presentations in conferences. You might want to get a copy of that. I'm waiting for an update though which is long overdue.

If you are free, we can pair program this weekend for a while. Maybe build an app or just solve some problems. Do you have a GitHub account?

Re: Type Inference by ektbear: 11:40pm On Jun 27, 2013
Sure. I've been wanting to write a simple IRC client to learn how Scala does GUIs and networking.

Yup I'm on Github.
Re: Type Inference by Fayimora(m): 12:14am On Jun 28, 2013
haha IRC Client should be fun. Scala has a wrapper around swing for GUIs but of course, most folks have a web/mobile-based front end. As for networking, you can simply use the already established Java libraries. There's also Twitter's Finagle and TypeSafe's Akka which can be useful. I haven't really used the former before but I have some understanding of the latter.

(1) (Reply)

Developing Mobile Applications Using Alpha Anywhere....must Read!!! / Object-oriented PHP / We are all Geeks, Discuss your ideas

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 28
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.