These are chat archives for dropbox/pyston

20th
Aug 2015
Kevin Modzelewski
@kmod
Aug 20 2015 06:59
hey @daetalus, here's a possible project:
for expressions like (1, 2), it'd be great if we didn't create the tuple at runtime
ie we already create the integers during codegen, but then we will emit something like
createTuple2(<embedded int constant>, <embedded int constant>)
so we already have the system to have codegen create the objects; we just need to identify the constant tuples and then pre-create those as well
Sun
@Daetalus
Aug 20 2015 08:11
Thanks @kmod I will investigate that.
Kevin Modzelewski
@kmod
Aug 20 2015 21:08
hey all, I just spent some time updating our documentation
check it out!
let me know what you think
+ feel free to make edits
Sun
@Daetalus
Aug 20 2015 21:08
Great!
Sun
@Daetalus
Aug 20 2015 21:19

Hi @kmod in Technical-overview, Garbase Collector section.

We currently use a stop-the-work mark-and-sweep collector

stop-the-work and stop-the-world has same meaning?

Kevin Modzelewski
@kmod
Aug 20 2015 21:21
oops sorry, typo
though still a somewhat accurate description :P
Sun
@Daetalus
Aug 20 2015 21:22
Indeed.
Would you mind to discuss about the minor project about "constant tuple"?
If you have time.
Kevin Modzelewski
@kmod
Aug 20 2015 21:24
sure thing :)
so I think the function that needs to get modified is TupleType::makeConverted
this is what emits the code to actually box up the tuple
we would need to have that first check if the values are constant, and if they are, then get the constant version of the tuple
similar to how we call parent_module->getIntConstant()
Sun
@Daetalus
Aug 20 2015 21:28
I see. but getIntConstant seems get the Integral directly from LLVM.
So we need to create something like constant tuple pool?
Kevin Modzelewski
@kmod
Aug 20 2015 21:29
heh so I guess we also have getConstantInt which is different from getIntConstant
getConstantInt creates an LLVM literal for an integer
but getIntConstant takes an integer and returns a Box*
that gets cached on the module object
Sun
@Daetalus
Aug 20 2015 21:29
Ah, sorry...
Kevin Modzelewski
@kmod
Aug 20 2015 21:30
so we'll need a BoxedModule::getTupleConstant
and then some way of knowing if the values we're boxing into the tuple are a constant or not
the hacky way to do that would be to check if the llvm::Value* is an intToPtr
probably the better way is to extend the type system to have something like Box* ConcreteCompilerVariable::getCompileTimeConstant()
which returns the value if it's constant or NULL if it's not
Sun
@Daetalus
Aug 20 2015 21:39
Much clearer. Would llvm::Constant could help to check whether the value is constant?
Kevin Modzelewski
@kmod
Aug 20 2015 21:43
yeah probably
Sun
@Daetalus
Aug 20 2015 21:56
Find one solution: isa<Constant>(V) seems could help. I will verify it.