code logs -> 2011 -> Fri, 21 Oct 2011< code.20111020.log - code.20111022.log >
--- Log opened Fri Oct 21 00:00:44 2011
00:07 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:10 Derakon [chriswei@Nightstar-f68d7eb4.ca.comcast.net] has quit [[NS] Quit: leaving]
00:13 celmin|away is now known as celticminstrel
00:19 celticminstrel is now known as celmin|away
00:35 Vornicus-Latens is now known as Vornicus
00:43 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
00:47 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
00:47 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
00:51 celmin|away is now known as celticmistral
01:03 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
01:05 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
01:16 You're now known as TheWatcher[T-2]
01:20 You're now known as TheWatcher[zZzZ]
01:40 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:21 Kindamoody[zZz] is now known as Kindamoody
02:58 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:59 Derakon[AFK] is now known as Derakon
03:18 celticmistral is now known as celticminstrel
03:54 Derakon is now known as Derakon[AFK]
04:19 Derakon[AFK] is now known as Derakon
04:42
< Kazriko>
Python is terse compared to the other 3 languages I end up developing in.
04:43
< Kazriko>
C++, Isagraf/iec61131, and Telepace/ladder logic.
04:44
< Kazriko>
All 3 of which lack both terseness and comprehensibility.
04:45
< celticminstrel>
C++ has comprehensibility... at least sometimes.
04:46
< celticminstrel>
I'm not quite sure what is meant by terseness here... opposite of verbosity?
04:46
< celticminstrel>
ie something Java lacks in spades?
04:46
< McMartin>
No
04:46
< McMartin>
Not merely the absence of verbosity
04:46
< McMartin>
But the ability to encode large amounts of stuff into a tiny space.
04:47
< Kazriko>
C++ is the most comprehensible of the 3, yes. :)
04:47
< McMartin>
No, I'm going to have to say python's "for x in y" is more comprehensible than C++'s "for (std::vector<std::pair<std::string, boost::types::uint32_t> >::const_iterator x = y.begin(); x != y.end(); ++x)
04:47
< Kazriko>
To make python terse, you have to really learn your comprehensions though. That's really the main part of the language designed to be small. Other than that, it's only terse compared to older languages.
04:48
< McMartin>
Comprehensions Python took from Haskell basically wholesale, and made them a little more verbose (keywords instead of symbols) - and Haskell is, as noted, ML turned up to 11
04:48
< Kazriko>
Heh, I don't use any templates at all with C++, but I'm developing stuff running on 33mhz chips.
04:48
< Kazriko>
True.
04:49
< Kazriko>
I always wanted to learn an ML language. Which is the best to start with?
04:49 * McMartin is generally of the opinion that if you aren't using the STL, you aren't using C++, but just using C with some optimizations on function pointers in structs.
04:49
< McMartin>
Standard ML is the pretty one; OCaml is the ugly one that has the insanely fast compiler.
04:49
< Kazriko>
McMartin: True. That's really the only thing I use C++ for, the virtual function tables.
04:49
< Kazriko>
and a handful of the syntax changes.
04:50
< McMartin>
As in, "in races, idiomatic OCaml actually beats C++/STL"
04:50
< McMartin>
Most of those syntax changes made it into C99, though.
04:50
< Kazriko>
Yeah.
04:50
< McMartin>
But OCaml is *really* ugly
04:50
< McMartin>
Here, from memory, is factorial in Standard ML:
04:50
< Kazriko>
I don't know if the old compiler they use allows C99 though. :(
04:50
< McMartin>
fact 0 = 1;
04:50
< McMartin>
fact n = n * (fact (n-1));
04:51
< Kazriko>
neat. Reminds me of cleaner lisp.
04:51
< McMartin>
In OCaml, it's something more like fact n = case n of 0 -> 1 | n -> n * fact (n-1);;
04:51
< McMartin>
With the double semicolon.
04:51
< McMartin>
(ML didn't get the 'look nice' stuff until a standard post the one OCaml branched from)
04:52
< McMartin>
(Haskell looks even nicer, at the expense of significant whitespace by default)
04:52
< McMartin>
(Haskell is also a crazy moon language that has an entirely different model of computation; SML's is almost identical to Lisp.)
04:52
< Kazriko>
I'm OK with whitespace myself, Python is one of my 2 primary languages.
04:52
< McMartin>
Haskell (a) doesn't have assignable state and (b) does not perform computation until the point the value is used
04:53
< McMartin>
Which results in some very surprising interleavings, but it's safe because of (a).
04:53
< Kazriko>
(Luckily, I'm using less and less of telepace and isagraf these days.)
04:53
< McMartin>
It also means that you write a program that says "in the I/O part, read in this whole file, then pass it through this function" and what actually happens to an outside observer is that the function processes the file a character at a time, reading in a bit as needed.
04:53
< McMartin>
Lazy evaluation does weird things to one's headspace, and is terrifying and awesome simultaneously.
04:54
< McMartin>
SML is noticably more practical by any reasonable measure, though the modern Scheme compilers are probably the most practical of all.
04:54
< Kazriko>
That actually is similar to what newer python does if you do iterators and generators...
04:54
< McMartin>
Right
04:54
< McMartin>
Basically, in Haskell, *everything* is a generator, including +.
04:54
< McMartin>
And because everything is side-effect free it can coalesce operations basically at will
04:54
< Kazriko>
Interesting...
04:55
< McMartin>
As far as Scheme goes, there's a variant called "Racket" I've heard many good things about, and the "Gambit" compiler has been used for commercial games.
04:57
< Kazriko>
scheme is more lispy than the rest though, eh?
04:57
< Kazriko>
as far as syntax goes?
04:58
< McMartin>
Scheme is a LISP dialect, yes.
04:58
< McMartin>
However, a lot of the modern Schemes - Gambit and Racket included - have less LISPy syntax forms.
04:58
< McMartin>
Heresy, sez I - if you're going to go with that you may as well use ML
04:58
< Kazriko>
heh.
04:59
< McMartin>
Biggest difference between ML/Haskell and LISP though is that ML and Haskell are both strongly statically typed, while Lisp is closer to Python
04:59
< McMartin>
However, ML and Haskell have thermonuclear type inference on them.
04:59
< Kazriko>
I used Common Lisp back in college, but haven't done anything with it since.
04:59 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
04:59
< McMartin>
And will always pick the maximally polymorphic version of it.
04:59
< McMartin>
Which is also awesome, because if it concludes that the best typing it can come up with for your function is function: 'a -> 'b...
04:59
< McMartin>
... that is, it cannot deduce a return type...
04:59
< McMartin>
... then it has in fact proven that your code is a permanent infinite loop.
05:01 * Kazriko wonders if the ocaml runtime bits could fit on a 33mhz arm with limited ram...
05:01
< McMartin>
Implausible; it's garbage collected
05:01
< McMartin>
And it's using a non-standard ABI that lets it do some crazy things, but they do tend to require a garbage-collected run-time to truly get away with it
05:02
< McMartin>
But the flipside of it is that throwing and catching an exception in OCaml is two machine instructions on x86
05:02
< Kazriko>
So i'd probably want to wait until I switched up to a 400 or 600mhz gumstix board before I did anything with it...
05:03
< McMartin>
I'm not sure if OCaml has an ARM code generator; I've only ever seen x86
05:03
< Kazriko>
Hmm.
05:04
< McMartin>
IA32, PowerPC, AMD64, Alpha, Sparc, Mips, IA64, HPPA, StrongArm
05:04
< McMartin>
From http://caml.inria.fr/ocaml/index.en.html
05:04
< Kazriko>
http://www.cs.cmu.edu/~ecc/ocaml-cross-compiler.html
05:04
< Kazriko>
yep...
05:05
< Kazriko>
the GCC this system uses is pretty ancient. 2002 or 2003 ancient.
05:05
< McMartin>
... yeah, I guess one could compile the bytecode interpreter and then run that.
05:05
< McMartin>
ocamlopt has the curse of all not-wildly-popular languages in that it generally has to statically link its whole standard library, which means Hello World is like 5MB.
05:06
< McMartin>
Some Linux distros have a libocaml to get around that, IIRC, but.
05:06
< Kazriko>
ok, that'd probably not work... heh
05:06
< Kazriko>
Our main application is 267k in size, and it takes forever to load.
05:06
< Kazriko>
the PLC only has about 8megs of program memory.
05:06
< McMartin>
Yeah, no
05:07
< Kazriko>
and about 4megs of application ram.
05:07
< McMartin>
Functional programming is for when you want answers to things that are tricky to specify, but you have considerable iron to throw at them.
05:07
< Kazriko>
for variables/etc
05:08
< Kazriko>
I've started implementing stuff in Python to run on theoretical future PLCs that we don't have yet.
05:08 * McMartin nods
05:08
< McMartin>
If you're using C-like systems, ML is handy to know because its approach to data-driven programming is basically the complement of C++'s.
05:08 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
05:08
< McMartin>
The usual name for that being "tagged unions"
05:09
< Kazriko>
Actually, I've started implementing a whole set of python utilities to emulate the PLC itself on a PC, which could be used on a better embedded system to emulate those cheesy little plcs.
05:09
< McMartin>
I would normally say that you need to know both vtables and tagged unions to be a fully proficient C programmer in this day and age.
05:09
< McMartin>
Woo, emulation
05:10 * McMartin has never really used a Standard ML system he's really liked, but seems to recall some people here have.
05:10
< McMartin>
I defer to them on this issue.
05:10
< Kazriko>
http://www.controlmicrosystems.com/products/scadapack-smart-rtus/scadapack-350/ << that thing.
05:11
< McMartin>
If you want to play at functional, Gambit compiles to C
05:11
< McMartin>
And somehow preserves tail recursion elimination and call/cc, via some mechanism I cannot even guess at
05:11
< Kazriko>
I've done vtables and tagged unions, but I like letting preprocessors handle the vtables for me...
05:11
< Kazriko>
Easier to switch things from virtual to non-virtual that way...
05:11
< McMartin>
Yup
05:12
< McMartin>
Anyway, ML is built largely around the equivalent of tagged unions
05:13
< McMartin>
But it doesn't call them that, of course
05:14 * Kazriko looks at the gambit scheme wiki.
05:17 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:19 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:19 * Kazriko then switches to "pythonista in schemeland" to get an overview...
05:21 * Derakon mutters.
05:21
< Derakon>
The problem with OpenGL programming is that when you get it wrong you have very little idea what exactly is incorrect.
05:21
< Kazriko>
Yeah. I ran into that issue before.
05:24
< Derakon>
Also I'm trying to avoid the GLUT library, but every tutorial on setting up views in OpenGL uses it.
05:26
< Kazriko>
nod...
05:26
< Kazriko>
I used orthogonal projection with my graphics class project because I never could get the perspective view to work right...
05:27
< McMartin>
Heh. My graphics class insisted we use both on the same screen, presumably to make sure we could do the difference right. -_-
05:28
< Kazriko>
They were pretty lenient about our projects. I think I was the only one who did a game in opengl.
05:28
< Kazriko>
one person did an animation in 3d with linear polarized projectors in POV.
05:29
< Kazriko>
but he was the resident POV wizard, his AI class project was a tree generator that made non-intersecting trees genetically in POV.
05:41 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
05:43
< Derakon>
I don't suppose anyone can debug this? http://pastebin.com/sdxwrnpx
06:08 kwsn [kwsn@Nightstar-635d16fc.org] has quit [Ping timeout: 121 seconds]
06:12 Derakon is now known as Derakon[AFK]
06:17 kwsn [kwsn@6824B1.5AFD35.C0F31F.42DAA5] has joined #code
06:19 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has quit [[NS] Quit: I <3Lovecraft<3 Vorn!]
06:51 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:05
< Rhamphoryncus>
Kazriko: sounds like exactly exactly the sort of usage my language is intended for. Systems language, suitable for embedded and high performance, but with a more pythonic attitude
07:07
< Kazriko>
I really want to move to a higher performance board here. This 33mhz thing is killing me... Especially when you put other people's programs on it.
07:08
< Kazriko>
A polling loop to poll an external modbus device then write a shutdown back out was taking as much as 25 seconds with that other program on there...
07:08
< Kazriko>
I had to setup a separate thread with a higher priority than the other program to get a poll in edgewise.
07:09
< Kazriko>
even still, it's taking nearly 10 seconds.
07:09
< Kazriko>
most of that is delays on the wireless stuff though.
07:18 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
07:21 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
07:21 mode/#code [+qo Vornicus Vornicus] by ChanServ
07:34 Kindamoody is now known as Kindamoody|out
07:48 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
08:19
< Rhamphoryncus>
I find it interesting t hat haskell's listcomps are more verbose than in haskell. Do our brains really parse symbols that differently from keywords?
08:45
< McMartin>
Er, you presumably meant "python's" first, right?
08:45
< McMartin>
Python has this Thing about keyword recycling.
08:45
< McMartin>
And it's not *that* much more verbose.
08:45
< McMartin>
[(a, b) for a in range(1, 10) for b in range (1, 10) if a < b] # Python
08:46
< McMartin>
[(a, b) | a <- [1..10], b <- [1..10], a < b] -- Haskell
08:46
< McMartin>
Actually, make the [] be () for Python, since to be precisely equivalent Python should be using a generator expression there.
08:57
< Rhamphoryncus>
I'm ignoring chaining. Never seemed like a good idea to me :P
08:58
< McMartin>
Ignore chaining and the only difference between the two is that "for, in" become "|, <-"
08:59
< Rhamphoryncus>
yup
08:59
< Rhamphoryncus>
yet it still feels more verbose to me
09:01<~Vornicus> ADD 1 TO COBOL GIVING COBOL
09:03 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client exited]
09:08 You're now known as TheWatcher
09:33
< Simon_Shine>
McMartin, is chaining what makes commas unnecessary in the python version?
09:50
< McMartin>
Simon_Shine: I think it's that Haskell can interpret the difference between boolean expressions (if) and monadic combinators (for) all on its own.
10:11 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
10:57 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has joined #code
11:24 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
12:34 Simon_Sh1ne [simon@Nightstar-883ecc1d.brahmaserver.dk] has joined #code
12:35 Simon_Shine [simon@Nightstar-883ecc1d.brahmaserver.dk] has quit [Ping timeout: 121 seconds]
13:03 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
13:06 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
13:47 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has quit [[NS] Quit: Away, to glory!]
14:09 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
14:39 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:27 Kindamoody|out is now known as Kindamoody
15:34 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
15:35 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
16:24
< Simon_Sh1ne>
in english, what are these phones called: http://www.mobilsiden.dk/gfx/public/upload/21300.jpg
16:27
< gnolam>
Rotary phone?
16:28
< gnolam>
Or did you mean the specific model?
16:29
< Simon_Sh1ne>
no, rotary phone. thanks.
17:08 Derakon[AFK] is now known as Derakon
17:20 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:21 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:27 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:35 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:56 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [Connection closed]
17:56 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:57 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
19:16 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
19:45 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
19:45 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
20:12 Kindamoody is now known as Kindamoody[zZz]
20:20
< ToxicFrog>
Kazriko: wait, is the implication there that you have an itty bitty embedded system at 33MHz with a preemptive threading environment on it?
21:02 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
21:07 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
21:10 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
21:19 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
21:20 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
21:52 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
21:59 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
21:59 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
22:07 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
22:09
< Derakon>
...apparently the way I learned to draw primitives in OpenGL is deprecated now.
22:09
< Derakon>
That being to do like glBegin(GL_LINE_LOOP), glVertex3f(...), etc.
22:09
< McMartin>
... how did you learn to draw primitives in OpenGL... oh
22:09
< McMartin>
That's *always* been deprecated.
22:09
< Derakon>
But it's bloody accessible.
22:09
< McMartin>
Except, originally, for dynamically morphing models.
22:09
< McMartin>
Kinda
22:09
< Derakon>
So I get handed this 300-line-long program that does everything with shaders.
22:10
< McMartin>
Yeah, OK, so, that's a different thing.
22:10
< Derakon>
All I want is a simple program that sets up a view without using glut and then draws something visible!
22:10
< McMartin>
Even in the Old Testament of my OpenGL Bible, vertex arrays mean you make one call and you get a complete model drawn.
22:10
< McMartin>
Shaders are New Testament.
22:10
< Derakon>
Because what I have is giving me a black screen and I have no clue why.
22:10
< McMartin>
(Seriously, these are what the divisions are called)
22:11 * Derakon sighs, is frustrated.
22:11 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
22:12
< McMartin>
That said, um
22:12
< McMartin>
These are different systems.
22:12
< McMartin>
shaders come up at the per-fragment level.
22:12
< McMartin>
You're talking about vertex submission.
22:12
< McMartin>
For static geometry, precompiled vertex arrays were *always* the "do this" thing because it minimizes bus traffic, etc.
22:12
< McMartin>
Sable has source code available~
22:13
< Derakon>
I can't believe there's not a 50-line-long example program that does what I'm looking for.
22:13
< Derakon>
Set up screen, set up view transform, draw cube, done.
22:13
< McMartin>
Um
22:13
< McMartin>
Pretty sure that's a sample program in the OpenGL Bible, which I think has online downloads, one moment.
22:15
< McMartin>
http://www.opengl.org/sdk/docs/books/SuperBible/
22:15
< McMartin>
Look at, say, the chapter 3 sources.
22:15
< Derakon>
Thanks.
22:15
< McMartin>
(Also, I see there's been yet another major revision to the book since I last got one -_-)
22:21
< Derakon>
This uses glut, which I was trying to avoid.
22:22
< Derakon>
Though maybe it doesn't use it for viewport stuff...
22:29<~Vornicus> Ah, correction: the aeon saucer takes off after like 25 minutes.
22:34
< McMartin>
Bear in mind that GLUT and GLU are different.
22:34
< Derakon>
...ah?
22:34
< Derakon>
Still, "glutInit" is suspicious~
22:34<~Vornicus> yeah - GLU is a variety of utility functions, but includes no windowing or anything
22:34
< McMartin>
That is, yes, but you're going to see that in all sample code.
22:34
< McMartin>
Ignore that part, that's to avoid system-specific windowing code
22:35
< McMartin>
GluPerspective, in particular is Kind Of Important.
22:35<~Vornicus> (glu gives you, for instance, an easy persp--- that)
22:35
< McMartin>
Becuase otherwise you have to use GlFrustum by hand if you aren't doing orthographic.
22:35
< McMartin>
Protip: never use GlFrustum directly, it is always the wrong thing to do.
22:35<~Vornicus> But anything that says "glut"you'll want to replace with your own windowing/etc code.
22:35
< Derakon>
Which SDL is handling for me.
22:36
< McMartin>
Yeah, so you can ignore all windowing and key handling code.
22:37
< McMartin>
If you need pointers to the SDL way to handle that stuff, https://hkn.eecs.berkeley.edu/~mcmartin/sable/ uses SDL.
22:38
< McMartin>
But it also uses compiled vertex arrays, so the rendering code isn't the part you want.
22:38
< Derakon>
I'm thinking I should probably eat lunch before diving into this more, though~
22:40 * McMartin is also eating lunch now, woo
22:40
< McMartin>
And by woo I mean >_<
22:41 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
22:42 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
22:48 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
23:23 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
--- Log closed Sat Oct 22 00:00:59 2011
code logs -> 2011 -> Fri, 21 Oct 2011< code.20111020.log - code.20111022.log >

[ Latest log file ]