code logs -> 2016 -> Thu, 18 Aug 2016< code.20160817.log - code.20160819.log >
--- Log opened Thu Aug 18 00:00:12 2016
00:15 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
01:19 Alek [Alek@Nightstar-9qtiqv.il.comcast.net] has joined #code
01:19 mode/#code [+o Alek] by ChanServ
01:30 Kindamoody is now known as Kindamoody[zZz]
02:08 himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has joined #code
02:08 mode/#code [+o himi] by ChanServ
02:09 catadroid` [catadroid@Nightstar-4dpc87.dab.02.net] has joined #code
02:13 catadroid [catadroid@Nightstar-i48.klt.132.82.IP] has quit [Ping timeout: 121 seconds]
03:25 ErikMesoy [Erik@Nightstar-hq72t5.customer.cdi.no] has quit [Ping timeout: 121 seconds]
03:45 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Leaving]
03:45 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
03:45 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
04:50 Netsplit Deepthought.Nightstar.Net <-> Krikkit.Nightstar.Net quits: @PinkFreud
05:31 Derakon is now known as Derakon[AFK]
05:41 * Vornicus resumes streaming Let's Make Vornball: https://www.twitch.tv/vornotron
06:34 ErikMesoy [Erik@Nightstar-hq72t5.customer.cdi.no] has joined #code
06:34 mode/#code [+o ErikMesoy] by ChanServ
06:44 celticminstrel is now known as celmin|sleep
07:38 wolfmoon [uid178473@Nightstar-6br85t.irccloud.com] has joined #code
07:38
< wolfmoon>
Hello :D
07:57 Kindamoody[zZz] is now known as Kindamoody
08:01 * Pi waves
08:02 * catadroid` particles
08:04
< wolfmoon>
How does one wave, Pi?
08:04
< catadroid`>
Periodically
08:06
<@Pi>
You take the sine function through multiples of pi :D
08:10 himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has quit [Ping timeout: 121 seconds]
08:11
< catadroid`>
It's all Greek to me
08:12
< wolfmoon>
Pi.
08:12
< wolfmoon>
Really
08:12
< wolfmoon>
Really
08:12
< wolfmoon>
Really XD
08:14
< wolfmoon>
sin(Î )
08:28 ion [Owner@Nightstar-2qv0j0.vs.shawcable.net] has quit [Ping timeout: 121 seconds]
08:40 catadroid [catadroid@Nightstar-v934ne.dab.02.net] has joined #code
08:42 catadroid` [catadroid@Nightstar-4dpc87.dab.02.net] has quit [Ping timeout: 121 seconds]
08:52 ion [Owner@Nightstar-oj1.09k.65.184.IP] has joined #code
09:07 * VirusJTG yawns, stretches, infects wolfmoon, goes back to poking at firewalls
09:10 Kindamoody is now known as Kindamoody|afk
09:15 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
09:34 catadroid [catadroid@Nightstar-v934ne.dab.02.net] has quit [[NS] Quit: Bye]
10:17 ion [Owner@Nightstar-oj1.09k.65.184.IP] has quit [Ping timeout: 121 seconds]
10:20 ion [Owner@Nightstar-oj1.09k.65.184.IP] has joined #code
10:47 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
10:47 mode/#code [+o himi] by ChanServ
11:42 catadroid [catadroid@Nightstar-v934ne.dab.02.net] has joined #code
11:43
< catadroid>
Send help. I'm considering the merits if writing a lisp that compiles to Go
11:43
< catadroid>
Of*
11:43
< catadroid>
Also, it strikes me that Lisp is by definition the ultimate in data driven programming
12:06
< catadroid>
Hm.
12:07
< catadroid>
I need to stop thinking about language design and write more code.
12:10
< wolfmoon>
I just search for and find the nicest language to work with. And for me it was Python since I started with it and it is actually nice to read :)
12:11
< wolfmoon>
I am too inexperienced with those languages (whatever lisp is) to help though
12:12
< catadroid>
Ah, it's more that I'm always trying to learn more and I ought to use them for real tasks to cement the knowledge
12:12
< catadroid>
Otherwise it's all just so much theory
12:23
< wolfmoon>
Ah, okay. Yeah, too many languages does not really help if you are not profficient with at least one
12:23
<@simon>
catadroid, why do you want to compile to Go?
12:26
< catadroid>
Because I really it's concurrency primitives
12:26
< catadroid>
And I want it's runtime
12:26
< catadroid>
I really like it's concurrency primitives*
12:27
< catadroid>
wolfmoon: I am excessively proficient in C++ and have working knowledge of a number of others, but in this case I really need to write actual Go applications to understand it
12:28
< wolfmoon>
catadroid: Ah :) well then yeah, that is always fun to do.
12:28
< catadroid>
There's some things I dislike about Go, but I really want to use goroutines in a non trivial task to get a feel for them
13:23
< ToxicFrog>
I'm weak on goroutines, but AIUI clojure's core.async gives you similar primitives
13:23
< ToxicFrog>
In both coroutine and thread flavours*
13:23
< ToxicFrog>
* unless you're targeting JS, in which case you only get the former
13:24
< ToxicFrog>
Also, good morning!
13:24 * ToxicFrog snuggles catadroid
15:03
< catadroid>
Hm. I think there's probably a relevant difference between potential complexity and actualized complexity
15:04
< catadroid>
Oh, async in clojure gives you effectively a superset of the same primitives
15:04
< catadroid>
But they still run on the JVM
15:05
< catadroid>
And i have something novel in mind that would involve avoiding the JVM potentially
15:05
< catadroid>
Which involves me needing to understand how Haskell is implemented
15:09 catadroid` [catadroid@Nightstar-hjk07h.dab.02.net] has joined #code
15:11
<@Pi>
catadroid: I have some vague knowledge of GHC internals.
15:11
<@Pi>
There's a pretty optimised multi-core async I/O scheduler inside.
15:11 catadroid [catadroid@Nightstar-v934ne.dab.02.net] has quit [Ping timeout: 121 seconds]
15:29
< catadroid`>
I'm largely interested in how IO actions and the code that depends on their results is actualized into executable choice
15:29
< catadroid`>
Executable code*
15:30
< ToxicFrog>
catadroid`: if you write a clojure compiler that emits go/C/rust/object code, I am all over that~
15:30
< catadroid`>
Hehe
15:32 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
15:32 mode/#code [+o PinkFreud] by ChanServ
15:38
< catadroid`>
I'm currently writing clojure code that uses coroutines and channels instead of functions
15:38
< catadroid`>
It's enlightening
15:40
<@Pi>
catadroid`: It pretty much just get translated to assembly or other primitives, I think.
15:40
<@Pi>
It's not essentially any different to how any other source code gets compiled to imperative executable machine code.
15:41
<@Pi>
By analogy, in imperative languages, simply everything is IO actions all the time.
15:41
<@Pi>
Haskell just refines that view a little bit by making the IO actions explicit instead of implicit.
15:41
<@Pi>
Thus allowing non-IO-action code to be compiled more simply, efficiently, and freely.
15:41
<@Pi>
Without all the constraints attached to IO actions.
15:42
<@Pi>
In imperative languags those constraints are just always-on, instead of optional. :)
15:45
<@Pi>
catadroid`: To put it another way, if you have a simple Haskell program like: main = putStrLn "foo" *> putStrLn "bar"
15:45
< catadroid`>
I want a lisp that handles the difference between eval and reduction to actions then performs execution of that instance separately
15:45
< catadroid`>
I think
15:45
<@Pi>
Then that just gets desugared and compiled down to Core (GHC's internal representation), until it gets to the underlying primitive implementation of putStrLn.
15:46
<@Pi>
And then it outputs an executable containing machine code and system calls and whatever corresponding to that chaining of primitive operations.
15:46
<@Pi>
You can do that in an existing Lisp, if you want.
15:47
<@Pi>
Just replace all your effects with constructors for an ADT (instead of procedures performing side effects).
15:47
<@Pi>
And then you have a separate executor for that ADT.
15:48
<@Pi>
In Haskell, IO is often explained by having people write their own MyIO ADT, containing all the primitive actions.
15:48
<@Pi>
And then implementing an interpreter / executor for that ADT.
15:48
<@Pi>
Just to show that it's not magic.
15:49
<@Pi>
Here's an example of that: http://chris-taylor.github.io/blog/2013/02/09/io-is-not-a-side-effect/
15:50
< catadroid`>
That sounds like no one needs to mention the word monad
15:50
<@Pi>
Right.
15:50
<@Pi>
That just defines a data type like: data IOAction a = Return a | Put String (IOAction a) | Get (String -> IOAction a)
15:50
<@Pi>
That's a trivial toy IO action type that only supports two operations.
15:51
<@Pi>
The above is pure data, by the way, just like any other Haskell list or tree or any other user-defined data type.
15:51
<@Pi>
You can see in that example how they define a basic program using those IO actions, and then get a compound IOAction data value out.
15:52
<@Pi>
which describes all the actions to be taken.
15:52
<@Pi>
And then lower down they implement a "run" function that interprets that ADT as the actual corresponding Haskell IO actions
15:53
<@Pi>
But instead of that you can equally implement a "compile" function that translates the ADT to executable code.
15:53
<@Pi>
Machine code, or JavaScript, or whatever you want to compile it to. :)
15:53
<@Pi>
It's just converting data from one representation to another.
15:54
<@Pi>
GHC is just a very sophisticated implementation of the above "compile" function.
15:54
<@Pi>
And its representation of IO actions is just a bit more nuanced and fancy than the above. :)
15:56
<@Pi>
catadroid`: If you're feeling adventurous, http://okmij.org/ftp/Scheme/monad-in-Scheme.html has some musings about implementing monadic code in Scheme.
15:57
<@Pi>
And there's an example there under "Generalizations to several monads" of some IO-using code in Haskell transliterated to Scheme.
15:57
<@Pi>
So that should give you an idea of what it would look like.
15:58
<@Pi>
As you see there, one of the main things that make functorial / monadic code cumbersome in languages without Hindley-Milner-style type inference is that you have to explicitly specify which functor / monad you're working with for every use of each operator.
15:59
<@Pi>
Which gets verbose fast.
15:59
<@Pi>
In Haskell, you can omit almost all of that because they're defined as type classes instead, and the correct instance gets inferred for you.
16:06 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
16:06 celmin|sleep is now known as celticminstrel
16:07 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
16:09 Derakon[AFK] is now known as Derakon
16:22 catadroid` is now known as catadroid
16:24
< ToxicFrog>
Pi: all of your explanations have made IO in Haskell make much more sense to me; thank you.
16:24 wolfmoon [uid178473@Nightstar-6br85t.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
16:24
<@Pi>
ToxicFrog: Glad I could help :D
16:25
<@Pi>
If you have any questions, fire away.
16:33
< catadroid>
Ditto
16:40
< catadroid>
Hrm
17:06 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
17:06 mode/#code [+qo Vornicus Vornicus] by ChanServ
17:14 wolfmoon [wolfmoon@Nightstar-040.48u.177.41.IP] has joined #code
17:55
< wolfmoon>
Hello
17:55
< wolfmoon>
So I have a question
17:56
< wolfmoon>
I am having issues importing .models for my Django file and I require this in order to write my retrieved info to my DB
17:56
< wolfmoon>
Could this just be a bad import or should the file be registered somewhere or what?
18:02
<&[R]>
"issues"?
18:24
< wolfmoon>
Traceback (most recent call last):
18:24
< wolfmoon>
File "/home/wolfmoon/WeatherApp/WeatherModule/weather_news24.py", line 4, in <module>
18:24
< wolfmoon>
import models
18:24
< wolfmoon>
File "/home/wolfmoon/WeatherApp/WeatherModule/models.py", line 10, in <module>
18:25
< wolfmoon>
class weather_record(models.Model):
18:25
< wolfmoon>
File "/home/wolfmoon/WeatherApp/WeatherModule/models.py", line 14, in weather_record
18:25
< wolfmoon>
created_date = models.DateField(default=0)
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/site-packages/django/db/mode ls/fields/__init__.py", line 1187, in __init__
18:25
< wolfmoon>
super(DateField, self).__init__(verbose_name, name, **kwargs)
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/site-packages/django/db/mode ls/fields/__init__.py", line 166, in __init__
18:25
< wolfmoon>
self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/site-packages/django/conf/__ init__.py", line 55, in __getattr__
18:25
< wolfmoon>
self._setup(name)
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/site-packages/django/conf/__ init__.py", line 43, in _setup
18:25
< wolfmoon>
self._wrapped = Settings(settings_module)
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/site-packages/django/conf/__ init__.py", line 99, in __init__
18:25
< wolfmoon>
mod = importlib.import_module(self.SETTINGS_MODULE)
18:25
< wolfmoon>
File "/home/wolfmoon/.conda/envs/ByteOrbit/lib/python2.7/importlib/__init__.py", line 30, in import_module
18:25
< wolfmoon>
raise TypeError("relative imports require the 'package' argument")
18:25
< wolfmoon>
TypeError: relative imports require the 'package' argument
18:25
< wolfmoon>
Issues XD
18:25
<@Pi>
You should use a pastebin for large snippets of code like that, by the way!
18:26
< wolfmoon>
What is pastebin?
18:26
<@Pi>
There's a link to one in the topic. :)
18:26
< wolfmoon>
Oh okay XD sorry
18:26
<@Pi>
It lets you paste large texts, and just share a small link here.
18:33
<&[R]>
<wolfmoon> TypeError: relative imports require the 'package' argument
18:57 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
19:51 catadroid` [catadroid@Nightstar-6lsb6p.dab.02.net] has joined #code
19:52 catadroid`` [catadroid@Nightstar-6lsb6p.dab.02.net] has joined #code
19:53 catadroid` [catadroid@Nightstar-6lsb6p.dab.02.net] has quit [The TLS connection was non-properly terminated.]
19:53 * Vornicus continues making vornball https://www.twitch.tv/vornotron
19:53 catadroid [catadroid@Nightstar-hjk07h.dab.02.net] has quit [Ping timeout: 121 seconds]
21:56
<@abudhabi>
Py3. Can I use a generator to just feed a function parameters?
21:56
<&Derakon>
I believe you'd need to stuff the generator's output into a tuple and then do func(*tuple)
21:57
<@abudhabi>
How do I stuff it into a tuple?
21:57
<&Derakon>
Or you could do func(generator) and have the function invoke the generator, I guess.
21:57
<@abudhabi>
The function here is print().
21:57
<&Derakon>
args = (i for i in generator()) or something like that.
21:57
<&Derakon>
I forget what the syntax is for tuple-ized list comprehensions in Py3.
22:00
<~Vornicus>
>>> print(i for i in range(10)) --> <generator object <genexpr> at 0x039CD940>
22:00
<~Vornicus>
>>> / print(tuple(i for i in range(10))) --> (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
22:00
<@abudhabi>
Hm.
22:00
<~Vornicus>
I missed with the slash, that was supposed to be one line
22:00
<@abudhabi>
Not quite what I have in mind. What I want is for print to work just as though it were fed params normally.
22:00
<&Derakon>
>>> print(*(i for i in range(10)))
22:00
<&Derakon>
Segmentation fault: 11
22:00
<&Derakon>
Wow.
22:01
<~Vornicus>
one more: >>> print(*tuple(i for i in range(10)))
22:01
<~Vornicus>
0 1 2 3 4 5 6 7 8 9
22:01
<&Derakon>
Yeah, Vorn's is what I was trying to get at.
22:01
<~Vornicus>
okay that is impressive, what the hell
22:01
<@abudhabi>
Vornicus: Thanks!
22:01
<&Derakon>
It appears that trying to do (i for i in range(10)) segfaults, at least for me.
22:01
<@abudhabi>
That worked.
22:02
<&Derakon>
abudhabi: the * operator explodes a tuple for you.
22:02
<&Derakon>
So func(*(a, b, c)) is equivalent to func(a, b, c).
22:02
<~Vornicus>
(it will also explode other sequences)
22:03
<&Derakon>
Likewise, the ** operator explodes a map into named parameters, so func(**{a: b, c: d}) is equivalent to func(a = b, c = d)
22:03
<&[R]>
Derakon: on Mandrake Linux, they shipped a version of libc that would segfault if you fopen()'d a file that didn't exist.
22:03
<&Derakon>
You can combine them; an idiomatic way to say "I accept arbitrary parameters" is func(param1, param2, *args, **kwargs)
22:04
<&Derakon>
And then you can pass on those parameters to some other function that you call; this can be useful e.g. for decorators
22:04
< catalyst>
wait, that's python?
22:04
<~Vornicus>
this is python
22:04
< catalyst>
huh
22:04
<@ErikMesoy>
Heavy wizardry python.
22:05
<@abudhabi>
http://pastebin.com/raw/LG3rjvEE
22:05
<~Vornicus>
nah, this is relatively tame
22:06
<&Derakon>
I don't usually count standard operators that are baked into the program syntax as heavy wizardry.
22:06
<&Derakon>
If you were using them in an unexpected fashion, maybe.
22:11
<@abudhabi>
Whoops, fencepost.
22:11
<@abudhabi>
http://pastebin.com/raw/wDCMgZ0r
22:12
< catalyst>
when did Python become Perl D:
22:14
<&Derakon>
A determined programmer can make spaghetti in anything.
22:14
<&Derakon>
Or play golf.
22:15
<@abudhabi>
catalyst: Perl is my *other* script language. :V
22:15
<@ErikMesoy>
Derakon: My impression is that *args, **kwargs is standard. Using * and ** elsewhere is where it starts to be wizardry.
22:16 * catalyst largely just wants to spend her life coding clojure now, I suspect
22:16 * abudhabi simplifies away that extra format string by using a hardcoded list instead of a range.
22:16
<&Derakon>
Erik: only if you consider reflection of any kind to be wizardry, I guess.
22:16
<@abudhabi>
Reflection is spider wizardry!
22:16
<&Derakon>
Which you might.
22:17
<@abudhabi>
Dark elves may be involved.
22:18
<@abudhabi>
Python is practically designed to be spaghettiable.
22:18
<@abudhabi>
There's syntax shortcuts for all kinds of things.
22:18
<@abudhabi>
Which will look nuts to a C/C++/Java programmer.
22:19
<@abudhabi>
(Maybe less Java. Java has bits like lambdas now.)
22:19
< catalyst>
You underestimate C++
22:20
<@abudhabi>
Maybe.
22:20
<@abudhabi>
I haven't touched it in years.
22:23
<&McMartin>
Yeah, C++11 is for all practical purposes an entirely different language
22:24
<@abudhabi>
What's new?
22:26
<&McMartin>
STL is drastically expanded, and standard protocol now involves basically using an automated reference counting facility
22:26
<&McMartin>
std::function papers over the difference between function pointers, lambda expressions, and classes that happen to override operator()
22:27
<&McMartin>
Lambdas themselves explicitly list which variables they capture and how (value vs reference) which makes them flexible enough to be safely used as copyable values when necessary, while not sacrificing performance when you can prove you copies are unnecessary
22:28
<&McMartin>
There is now a distinction between "copy" and "move" that makes a lot of hideous C++98 idioms involving std::swap go away and encodes a variety of optimizations directly into the language semantics
22:28
<&McMartin>
This also makes many other things more flexible because a lot of uncopyable types like std::iostream are actually perfectly fine for movability
22:29
<&McMartin>
If you actually didn't know about C++98, the language has full support for namespaces and most of a standard library too, so char * is only necessary for interoperating with C or assembly code~
22:30
<&McMartin>
It's still missing a few pieces of the standard I consider necessary to be a fully generic applications programming language, but libraries have existed for those since the late 1990s and the crucial bits are on the standards track
22:31
<&McMartin>
(The primary thing missing is std::filesystem; I would *like* the improvements to std::promise and std::future so that they are at least as usable as JavaScript's, but that's in the cards and even without it you can totally implement it yourself with boost::asio and maybe 50 lines of extra code)
23:00 Kindamoody|afk is now known as Kindamoody
23:15 wolfmoon [wolfmoon@Nightstar-040.48u.177.41.IP] has quit [[NS] Quit: Lost terminal]
23:33 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
23:38 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
23:41 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Fri Aug 19 00:00:28 2016
code logs -> 2016 -> Thu, 18 Aug 2016< code.20160817.log - code.20160819.log >

[ Latest log file ]