How to make simple Lambert in blender Open Shading Language?
You can't actually access the Lamp location directly within OSL (see Getting a light vector in OSL for Blender) but you can feed a Vector representing the lamp location into the shader to use in the calculation. The Vector can be captured directly from the Lamp location by using Drivers so that moving the lamp automatically affects the shading.



Here the Combine XYZ node has been setup with Drivers (right-click and Add Driver and then set up the driver to set each value to Lamp X Location, Y Location, Z Location). The Subtract Vector Maths node creates a vector by subtracting the Position of the point on the surface and the Normalize ensures it's of length 1. The result is passed into the OSL node to represent the direction of the Lamp.

Since the lamp location is captured using Drivers, moving the lamp automatically updates the Combine XYZ node to represent the new lamp location.

For multiple lamps you would need to add multiple Combine XYZ nodes, each driver by the respective lamp, and each passed into the OSL node on a new input to include in your calculation.